rust/tests/ui/consts/const-mut-refs/issue-76510.64bit.stderr
Tomasz Miąsko 67f455afe1 Suppress "erroneous constant used" for constants tainted by errors
When constant evaluation fails because its MIR is tainted by errors,
suppress note indicating that erroneous constant was used, since those
errors have to be fixed regardless of the constant being used or not.
2023-05-15 00:00:00 +00:00

26 lines
993 B
Plaintext

error[E0764]: mutable references are not allowed in the final value of constants
--> $DIR/issue-76510.rs:5:29
|
LL | const S: &'static mut str = &mut " hello ";
| ^^^^^^^^^^^^^^
error[E0658]: mutation through a reference is not allowed in constants
--> $DIR/issue-76510.rs:5:29
|
LL | const S: &'static mut str = &mut " hello ";
| ^^^^^^^^^^^^^^
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
error[E0596]: cannot borrow data in a `&` reference as mutable
--> $DIR/issue-76510.rs:5:29
|
LL | const S: &'static mut str = &mut " hello ";
| ^^^^^^^^^^^^^^ cannot borrow as mutable
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0596, E0658, E0764.
For more information about an error, try `rustc --explain E0596`.