]> git.lizzy.rs Git - rust.git/blob - tests/ui/thread-local-static.stderr
Rollup merge of #107740 - oli-obk:lock_tcx, r=petrochenkov
[rust.git] / tests / ui / thread-local-static.stderr
1 error[E0658]: mutable references are not allowed in constant functions
2   --> $DIR/thread-local-static.rs:7:12
3    |
4 LL | const fn g(x: &mut [u32; 8]) {
5    |            ^
6    |
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
9
10 error[E0625]: thread-local statics cannot be accessed at compile-time
11   --> $DIR/thread-local-static.rs:9:28
12    |
13 LL |     std::mem::swap(x, &mut STATIC_VAR_2)
14    |                            ^^^^^^^^^^^^
15
16 error[E0013]: constant functions cannot refer to statics
17   --> $DIR/thread-local-static.rs:9:28
18    |
19 LL |     std::mem::swap(x, &mut STATIC_VAR_2)
20    |                            ^^^^^^^^^^^^
21    |
22    = help: consider extracting the value of the `static` to a `const`, and referring to that
23
24 error[E0658]: mutable references are not allowed in constant functions
25   --> $DIR/thread-local-static.rs:9:23
26    |
27 LL |     std::mem::swap(x, &mut STATIC_VAR_2)
28    |                       ^^^^^^^^^^^^^^^^^
29    |
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
32
33 error[E0133]: use of mutable static is unsafe and requires unsafe function or block
34   --> $DIR/thread-local-static.rs:9:23
35    |
36 LL |     std::mem::swap(x, &mut STATIC_VAR_2)
37    |                       ^^^^^^^^^^^^^^^^^ use of mutable static
38    |
39    = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
40
41 error: aborting due to 5 previous errors
42
43 Some errors have detailed explanations: E0013, E0133, E0625, E0658.
44 For more information about an error, try `rustc --explain E0013`.