]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-17954.rs
Merge commit '97e504549371d7640cf011d266e3c17394fdddac' into sync_cg_clif-2021-12-20
[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 thread-local variable borrowed past end of function
9     //~| NOTE thread-local variables cannot be borrowed beyond the end of the function
10
11     std::thread::spawn(move || {
12         println!("{}", a);
13     });
14 }
15 //~^ NOTE end of enclosing function is here