]>
Commit | Line | Data |
---|---|---|
b7449926 XL |
1 | #![feature(thread_local)] |
2 | ||
3 | #[thread_local] | |
4 | static FOO: u8 = 3; | |
5 | ||
7453a54e | 6 | fn main() { |
b7449926 | 7 | let a = &FOO; |
48663c56 XL |
8 | //~^ ERROR thread-local variable borrowed past end of function |
9 | //~| NOTE thread-local variables cannot be borrowed beyond the end of the function | |
b7449926 XL |
10 | |
11 | std::thread::spawn(move || { | |
12 | println!("{}", a); | |
cc61c64b | 13 | }); |
223e47cc | 14 | } |
48663c56 | 15 | //~^ NOTE end of enclosing function is here |