mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
1576a6d618
update tests fix bitwidth-sensitive stderr output use build-fail for asm tests
22 lines
993 B
Plaintext
22 lines
993 B
Plaintext
error[E0764]: mutable references are not allowed in the final value of constants
|
|
--> $DIR/issue-17718-const-bad-values.rs:7:34
|
|
|
|
|
LL | const C1: &'static mut [usize] = &mut [];
|
|
| ^^^^^^^
|
|
|
|
error[E0080]: it is undefined behavior to use this value
|
|
--> $DIR/issue-17718-const-bad-values.rs:11:1
|
|
|
|
|
LL | const C2: &'static mut i32 = unsafe { &mut S };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
|
|
|
|
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
|
|
= note: the raw bytes of the constant (size: $PTR, align: $PTR) {
|
|
HEX_DUMP
|
|
}
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
Some errors have detailed explanations: E0080, E0764.
|
|
For more information about an error, try `rustc --explain E0080`.
|