Currently you (sometimes) get a panick if you use rand::random() in a TLS dtor. This is because the RNG state TLS var can have been deinitialized and thus unavailable. Ideally, rand should check if the TLS var is available (https://doc.rust-lang.org/nightly/std/thread/struct.LocalKey.html#method.state), and if not, fallback to the global RNG state.
Currently you (sometimes) get a panick if you use
rand::random()in a TLS dtor. This is because the RNG state TLS var can have been deinitialized and thus unavailable. Ideally,randshould check if the TLS var is available (https://doc.rust-lang.org/nightly/std/thread/struct.LocalKey.html#method.state), and if not, fallback to the global RNG state.