summaryrefslogtreecommitdiffstats
path: root/src/test/ui/threads-sendsync/issue-29488.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/threads-sendsync/issue-29488.rs')
-rw-r--r--src/test/ui/threads-sendsync/issue-29488.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/ui/threads-sendsync/issue-29488.rs b/src/test/ui/threads-sendsync/issue-29488.rs
new file mode 100644
index 000000000..3c9a6a80d
--- /dev/null
+++ b/src/test/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();
+}