]> git.lizzy.rs Git - rust.git/blob - src/test/ui/static/thread-local-in-ctfe.rs
Rollup merge of #105975 - jeremystucki:rustc-remove-needless-lifetimes, r=eholk
[rust.git] / src / test / ui / static / thread-local-in-ctfe.rs
1 #![feature(thread_local)]
2
3 #[thread_local]
4 static A: u32 = 1;
5
6 static B: u32 = A;
7 //~^ ERROR thread-local statics cannot be accessed at compile-time
8
9 static C: &u32 = &A;
10 //~^ ERROR thread-local statics cannot be accessed at compile-time
11
12 const D: u32 = A;
13 //~^ ERROR thread-local statics cannot be accessed at compile-time
14
15 const E: &u32 = &A;
16 //~^ ERROR thread-local statics cannot be accessed at compile-time
17
18 const fn f() -> u32 {
19     A
20     //~^ ERROR thread-local statics cannot be accessed at compile-time
21 }
22
23 fn main() {}