summaryrefslogtreecommitdiffstats
path: root/tests/ui/threads-sendsync/issue-29488.rs
blob: 3c9a6a80dbf01643f690019f33e6ef893f464e92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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();
}