]>
Commit | Line | Data |
---|---|---|
17df50a5 XL |
1 | // edition:2018 |
2 | ||
3 | #![feature(thread_local)] | |
4 | #![feature(const_swap)] | |
5 | #[thread_local] | |
6 | static mut STATIC_VAR_2: [u32; 8] = [4; 8]; | |
7 | const fn g(x: &mut [u32; 8]) { | |
8 | //~^ ERROR mutable references are not allowed | |
9 | std::mem::swap(x, &mut STATIC_VAR_2) | |
10 | //~^ ERROR thread-local statics cannot be accessed | |
11 | //~| ERROR mutable references are not allowed | |
12 | //~| ERROR use of mutable static is unsafe | |
13 | //~| constant functions cannot refer to statics | |
17df50a5 XL |
14 | } |
15 | ||
16 | fn main() {} |