summary refs log tree commit diff
path: root/src/test/ui/issues/issue-17954.rs
blob: a8fbf2372b06aa22fdbf0ef83cefa5d99e4d7d78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![feature(thread_local)]

#[thread_local]
static FOO: u8 = 3;

fn main() {
    let a = &FOO;
    //~^ ERROR borrowed value does not live long enough
    //~| does not live long enough
    //~| NOTE borrowed value must be valid for the static lifetime

    std::thread::spawn(move || {
        println!("{}", a);
    });
}
//~^ NOTE borrowed value only lives until here