fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
1.2 KiB34 linesraw
1error[E0017]: references in constants may only refer to immutable values
2  --> $DIR/E0388.rs:4:30
3   |
4LL | const CR: &'static mut i32 = &mut C;
5   |                              ^^^^^^ constants require immutable values
6
7error[E0017]: references in statics may only refer to immutable values
8  --> $DIR/E0388.rs:5:39
9   |
10LL | static STATIC_REF: &'static mut i32 = &mut X;
11   |                                       ^^^^^^ statics require immutable values
12
13error: cannot mutate statics in the initializer of another static
14  --> $DIR/E0388.rs:5:39
15   |
16LL | static STATIC_REF: &'static mut i32 = &mut X;
17   |                                       ^^^^^^
18
19error[E0596]: cannot borrow immutable static item `X` as mutable
20  --> $DIR/E0388.rs:5:39
21   |
22LL | static STATIC_REF: &'static mut i32 = &mut X;
23   |                                       ^^^^^^ cannot borrow as mutable
24
25error[E0017]: references in statics may only refer to immutable values
26  --> $DIR/E0388.rs:8:38
27   |
28LL | static CONST_REF: &'static mut i32 = &mut C;
29   |                                      ^^^^^^ statics require immutable values
30
31error: aborting due to 5 previous errors
32
33Some errors have detailed explanations: E0017, E0596.
34For more information about an error, try `rustc --explain E0017`.