]> git.lizzy.rs Git - rust.git/blob - src/test/ui/error-codes/E0388.stderr
Rollup merge of #67102 - Aaron1011:patch-3, r=Mark-Simulacrum
[rust.git] / src / test / ui / error-codes / E0388.stderr
1 error[E0658]: 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    = 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
10 error[E0019]: static contains unimplemented expression type
11   --> $DIR/E0388.rs:5:39
12    |
13 LL | static STATIC_REF: &'static mut i32 = &mut X;
14    |                                       ^^^^^^
15
16 error[E0658]: references in statics may only refer to immutable values
17   --> $DIR/E0388.rs:5:39
18    |
19 LL | 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
25 error[E0596]: cannot borrow immutable static item `X` as mutable
26   --> $DIR/E0388.rs:5:39
27    |
28 LL | static STATIC_REF: &'static mut i32 = &mut X;
29    |                                       ^^^^^^ cannot borrow as mutable
30
31 error[E0658]: references in statics may only refer to immutable values
32   --> $DIR/E0388.rs:8:38
33    |
34 LL | 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
40 error: aborting due to 5 previous errors
41
42 Some errors have detailed explanations: E0019, E0596, E0658.
43 For more information about an error, try `rustc --explain E0019`.