fork/rust

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

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
2.2 KiB52 linesraw
1error[E0658]: references in constants may only refer to immutable values
2  --> $DIR/E0017.rs:5:30
3   |
4LL | const CR: &'static mut i32 = &mut C;
5   |                              ^^^^^^ constants require immutable values
6   |
7   = note: for more information, see https://github.com/rust-lang/rust/issues/57349
8   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
9
10error[E0019]: static contains unimplemented expression type
11  --> $DIR/E0017.rs:6:39
12   |
13LL | static STATIC_REF: &'static mut i32 = &mut X;
14   |                                       ^^^^^^
15
16error[E0658]: references in statics may only refer to immutable values
17  --> $DIR/E0017.rs:6:39
18   |
19LL | static STATIC_REF: &'static mut i32 = &mut X;
20   |                                       ^^^^^^ statics require immutable values
21   |
22   = note: for more information, see https://github.com/rust-lang/rust/issues/57349
23   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
24
25error[E0596]: cannot borrow immutable static item `X` as mutable
26  --> $DIR/E0017.rs:6:39
27   |
28LL | static STATIC_REF: &'static mut i32 = &mut X;
29   |                                       ^^^^^^ cannot borrow as mutable
30
31error[E0658]: references in statics may only refer to immutable values
32  --> $DIR/E0017.rs:9:38
33   |
34LL | static CONST_REF: &'static mut i32 = &mut C;
35   |                                      ^^^^^^ statics require immutable values
36   |
37   = note: for more information, see https://github.com/rust-lang/rust/issues/57349
38   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
39
40error[E0658]: references in statics may only refer to immutable values
41  --> $DIR/E0017.rs:10:52
42   |
43LL | static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M };
44   |                                                    ^^^^^^ statics require immutable values
45   |
46   = note: for more information, see https://github.com/rust-lang/rust/issues/57349
47   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
48
49error: aborting due to 6 previous errors
50
51Some errors have detailed explanations: E0019, E0596, E0658.
52For more information about an error, try `rustc --explain E0019`.