fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.7 KiB44 linesraw
1error[E0658]: mutable references are not allowed in constant functions
2  --> $DIR/thread-local-static.rs:7:12
3   |
4LL | 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
10error[E0625]: thread-local statics cannot be accessed at compile-time
11  --> $DIR/thread-local-static.rs:9:28
12   |
13LL |     std::mem::swap(x, &mut STATIC_VAR_2)
14   |                            ^^^^^^^^^^^^
15
16error[E0013]: constant functions cannot refer to statics
17  --> $DIR/thread-local-static.rs:9:28
18   |
19LL |     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
24error[E0658]: mutable references are not allowed in constant functions
25  --> $DIR/thread-local-static.rs:9:23
26   |
27LL |     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
33error[E0133]: use of mutable static is unsafe and requires unsafe function or block
34  --> $DIR/thread-local-static.rs:9:23
35   |
36LL |     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
41error: aborting due to 5 previous errors
42
43Some errors have detailed explanations: E0013, E0133, E0625, E0658.
44For more information about an error, try `rustc --explain E0013`.