]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-17718-const-bad-values.stderr
New upstream version 1.50.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-17718-const-bad-values.stderr
1 error[E0764]: mutable references are not allowed in constants
2 --> $DIR/issue-17718-const-bad-values.rs:1:34
3 |
4 LL | const C1: &'static mut [usize] = &mut [];
5 | ^^^^^^^ `&mut` is only allowed in `const fn`
6
7 error[E0013]: constants cannot refer to statics
8 --> $DIR/issue-17718-const-bad-values.rs:5:46
9 |
10 LL | const C2: &'static mut usize = unsafe { &mut S };
11 | ^
12 |
13 = help: consider extracting the value of the `static` to a `const`, and referring to that
14
15 error[E0013]: constants cannot refer to statics
16 --> $DIR/issue-17718-const-bad-values.rs:5:46
17 |
18 LL | const C2: &'static mut usize = unsafe { &mut S };
19 | ^
20 |
21 = help: consider extracting the value of the `static` to a `const`, and referring to that
22
23 error[E0764]: mutable references are not allowed in constants
24 --> $DIR/issue-17718-const-bad-values.rs:5:41
25 |
26 LL | const C2: &'static mut usize = unsafe { &mut S };
27 | ^^^^^^ `&mut` is only allowed in `const fn`
28
29 error: aborting due to 4 previous errors
30
31 Some errors have detailed explanations: E0013, E0764.
32 For more information about an error, try `rustc --explain E0013`.