fork/rust

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

borsAuto merge of #68568 - pietroalbini:stable-next, r=pietroalbini5e1a799842b

1.41.0
1.2 KiB28 linesraw
1error[E0658]: references in constants may only refer to immutable values
2  --> $DIR/issue-17718-const-bad-values.rs:1:34
3   |
4LL | const C1: &'static mut [usize] = &mut [];
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[E0013]: constants cannot refer to statics, use a constant instead
11  --> $DIR/issue-17718-const-bad-values.rs:5:46
12   |
13LL | const C2: &'static mut usize = unsafe { &mut S };
14   |                                              ^
15
16error[E0658]: references in constants may only refer to immutable values
17  --> $DIR/issue-17718-const-bad-values.rs:5:41
18   |
19LL | const C2: &'static mut usize = unsafe { &mut S };
20   |                                         ^^^^^^ constants 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: aborting due to 3 previous errors
26
27Some errors have detailed explanations: E0013, E0658.
28For more information about an error, try `rustc --explain E0013`.