]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-17954.rs
Rollup merge of #100168 - WaffleLapkin:improve_diagnostics_for_missing_type_in_a_cons...
[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