]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-17718-const-bad-values.stderr
bootstrap: Configurable musl libdir
[rust.git] / src / test / ui / issues / issue-17718-const-bad-values.stderr
1 error[E0658]: references in constants may only refer to immutable values
2   --> $DIR/issue-17718-const-bad-values.rs:1:34
3    |
4 LL | const C1: &'static mut [usize] = &mut [];
5    |                                  ^^^^^^^ constants require immutable values
6    |
7    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
8    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
9
10 error[E0013]: constants cannot refer to statics
11   --> $DIR/issue-17718-const-bad-values.rs:5:46
12    |
13 LL | const C2: &'static mut usize = unsafe { &mut S };
14    |                                              ^
15    |
16    = help: consider extracting the value of the `static` to a `const`, and referring to that
17
18 error[E0013]: constants cannot refer to statics
19   --> $DIR/issue-17718-const-bad-values.rs:5:46
20    |
21 LL | const C2: &'static mut usize = unsafe { &mut S };
22    |                                              ^
23    |
24    = help: consider extracting the value of the `static` to a `const`, and referring to that
25
26 error[E0658]: references in constants may only refer to immutable values
27   --> $DIR/issue-17718-const-bad-values.rs:5:41
28    |
29 LL | const C2: &'static mut usize = unsafe { &mut S };
30    |                                         ^^^^^^ constants require immutable values
31    |
32    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
33    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
34
35 error: aborting due to 4 previous errors
36
37 Some errors have detailed explanations: E0013, E0658.
38 For more information about an error, try `rustc --explain E0013`.