]> git.proxmox.com Git - rustc.git/blame - tests/ui/static/thread-local-in-ctfe.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / static / thread-local-in-ctfe.rs
CommitLineData
17df50a5 1#![feature(thread_local)]
3b2f2976
XL
2
3#[thread_local]
4static A: u32 = 1;
5
6static B: u32 = A;
7//~^ ERROR thread-local statics cannot be accessed at compile-time
3b2f2976
XL
8
9static C: &u32 = &A;
10//~^ ERROR thread-local statics cannot be accessed at compile-time
11
12const D: u32 = A;
13//~^ ERROR thread-local statics cannot be accessed at compile-time
3b2f2976
XL
14
15const E: &u32 = &A;
16//~^ ERROR thread-local statics cannot be accessed at compile-time
17
18const fn f() -> u32 {
19 A
20 //~^ ERROR thread-local statics cannot be accessed at compile-time
3b2f2976
XL
21}
22
23fn main() {}