]> git.lizzy.rs Git - rust.git/blob - src/test/ui/thread-local-in-ctfe.rs
Allow `Downcast` projections in `qualify_min_const_fn`
[rust.git] / src / test / ui / thread-local-in-ctfe.rs
1 #![feature(const_fn, 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 //~| ERROR thread-local variable borrowed past end of function
12
13 const D: u32 = A;
14 //~^ ERROR thread-local statics cannot be accessed at compile-time
15
16 const E: &u32 = &A;
17 //~^ ERROR thread-local statics cannot be accessed at compile-time
18 //~| ERROR thread-local variable borrowed past end of function
19
20 const fn f() -> u32 {
21     A
22     //~^ ERROR thread-local statics cannot be accessed at compile-time
23 }
24
25 fn main() {}