]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-17954.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-17954.rs
CommitLineData
b7449926
XL
1#![feature(thread_local)]
2
3#[thread_local]
4static FOO: u8 = 3;
5
7453a54e 6fn 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