]> git.lizzy.rs Git - rust.git/blob - src/test/ui/threads-sendsync/tls-dtors-are-run-in-a-static-binary.rs
Merge commit 'e18101137866b79045fee0ef996e696e68c920b4' into clippyup
[rust.git] / src / test / ui / threads-sendsync / tls-dtors-are-run-in-a-static-binary.rs
1 // run-pass
2 // no-prefer-dynamic
3 // ignore-emscripten no threads support
4
5 static mut HIT: bool = false;
6
7 struct Foo;
8
9 impl Drop for Foo {
10     fn drop(&mut self) {
11         unsafe { HIT = true; }
12     }
13 }
14
15 thread_local!(static FOO: Foo = Foo);
16
17 fn main() {
18     std::thread::spawn(|| {
19         FOO.with(|_| {});
20     }).join().unwrap();
21     assert!(unsafe { HIT });
22 }