]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-17954.rs
Auto merge of #57108 - Mark-Simulacrum:license-remove, r=pietroalbini
[rust.git] / src / test / ui / issues / issue-17954.rs
1 #![feature(thread_local)]
2
3 #[thread_local]
4 static FOO: u8 = 3;
5
6 fn main() {
7     let a = &FOO;
8     //~^ ERROR borrowed value does not live long enough
9     //~| does not live long enough
10     //~| NOTE borrowed value must be valid for the static lifetime
11
12     std::thread::spawn(move || {
13         println!("{}", a);
14     });
15 }
16 //~^ NOTE borrowed value only lives until here