1 error[E0658]: mutable references are not allowed in constant functions
2 --> $DIR/thread-local-static.rs:7:12
4 LL | const fn g(x: &mut [u32; 8]) {
7 = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
8 = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
10 error[E0625]: thread-local statics cannot be accessed at compile-time
11 --> $DIR/thread-local-static.rs:9:28
13 LL | std::mem::swap(x, &mut STATIC_VAR_2)
16 error[E0013]: constant functions cannot refer to statics
17 --> $DIR/thread-local-static.rs:9:28
19 LL | std::mem::swap(x, &mut STATIC_VAR_2)
22 = help: consider extracting the value of the `static` to a `const`, and referring to that
24 error[E0658]: mutable references are not allowed in constant functions
25 --> $DIR/thread-local-static.rs:9:23
27 LL | std::mem::swap(x, &mut STATIC_VAR_2)
30 = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
31 = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
33 error[E0133]: use of mutable static is unsafe and requires unsafe function or block
34 --> $DIR/thread-local-static.rs:9:23
36 LL | std::mem::swap(x, &mut STATIC_VAR_2)
37 | ^^^^^^^^^^^^^^^^^ use of mutable static
39 = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
41 error: aborting due to 5 previous errors
43 Some errors have detailed explanations: E0013, E0133, E0625, E0658.
44 For more information about an error, try `rustc --explain E0013`.