diff options
Diffstat (limited to 'tests/ui/threads-sendsync/issue-29488.rs')
-rw-r--r-- | tests/ui/threads-sendsync/issue-29488.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/threads-sendsync/issue-29488.rs b/tests/ui/threads-sendsync/issue-29488.rs new file mode 100644 index 000000000..3c9a6a80d --- /dev/null +++ b/tests/ui/threads-sendsync/issue-29488.rs @@ -0,0 +1,23 @@ +// run-pass +// ignore-emscripten no threads support + +use std::thread; + +struct Foo; + +impl Drop for Foo { + fn drop(&mut self) { + println!("test2"); + } +} + +thread_local!(static FOO: Foo = Foo); + +fn main() { + // Off the main thread due to #28129, be sure to initialize FOO first before + // calling `println!` + thread::spawn(|| { + FOO.with(|_| {}); + println!("test1"); + }).join().unwrap(); +} |