diff --git a/tests/many-seeds/tls-leak.rs b/tests/many-seeds/tls-leak.rs new file mode 100644 index 0000000000..70a506958d --- /dev/null +++ b/tests/many-seeds/tls-leak.rs @@ -0,0 +1,13 @@ +//! Regression test for . +use std::thread; + +pub(crate) fn with_thread_local() { + thread_local! { static X: Box = Box::new(0); } + X.with(|_x| {}) +} + +fn main() { + let j2 = thread::spawn(with_thread_local); + with_thread_local(); + j2.join().unwrap(); +}