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