]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/const-mut-refs/issue-76510.64bit.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / consts / const-mut-refs / issue-76510.64bit.stderr
1 error[E0764]: mutable references are not allowed in the final value of constants
2 --> $DIR/issue-76510.rs:5:29
3 |
4 LL | const S: &'static mut str = &mut " hello ";
5 | ^^^^^^^^^^^^^^
6
7 error[E0658]: mutation through a reference is not allowed in constants
8 --> $DIR/issue-76510.rs:5:29
9 |
10 LL | const S: &'static mut str = &mut " hello ";
11 | ^^^^^^^^^^^^^^
12 |
13 = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
14 = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
15
16 error[E0596]: cannot borrow data in a `&` reference as mutable
17 --> $DIR/issue-76510.rs:5:29
18 |
19 LL | const S: &'static mut str = &mut " hello ";
20 | ^^^^^^^^^^^^^^ cannot borrow as mutable
21
22 error[E0080]: evaluation of constant value failed
23 --> $DIR/issue-76510.rs:11:70
24 |
25 LL | let s = transmute::<(*const u8, usize), &ManuallyDrop<str>>((S.as_ptr(), 3));
26 | ^ referenced constant has errors
27
28 error: aborting due to 4 previous errors
29
30 Some errors have detailed explanations: E0080, E0596, E0658, E0764.
31 For more information about an error, try `rustc --explain E0080`.