]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-29488.rs
Merge commit '9a0c32934ebe376128230aa8da3275697b2053e7' into sync_cg_clif-2021-03-05
[rust.git] / src / test / ui / issues / issue-29488.rs
1 // run-pass
2 // ignore-emscripten no threads support
3
4 use std::thread;
5
6 struct Foo;
7
8 impl Drop for Foo {
9     fn drop(&mut self) {
10         println!("test2");
11     }
12 }
13
14 thread_local!(static FOO: Foo = Foo);
15
16 fn main() {
17     // Off the main thread due to #28129, be sure to initialize FOO first before
18     // calling `println!`
19     thread::spawn(|| {
20         FOO.with(|_| {});
21         println!("test1");
22     }).join().unwrap();
23 }