mirror of https://github.com/rust-lang/rust.git
21 lines
854 B
Plaintext
21 lines
854 B
Plaintext
|
error[E0080]: it is undefined behavior to use this value
|
||
|
--> $DIR/const_refs_to_static_fail_invalid.rs:7:1
|
||
|
|
|
||
|
LL | const C: &bool = unsafe { std::mem::transmute(&S) };
|
||
|
| ^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered 0x0a, but expected a boolean
|
||
|
|
|
||
|
= 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: $SIZE, align: $ALIGN) {
|
||
|
HEX_DUMP
|
||
|
}
|
||
|
|
||
|
error: could not evaluate constant pattern
|
||
|
--> $DIR/const_refs_to_static_fail_invalid.rs:14:9
|
||
|
|
|
||
|
LL | C => {},
|
||
|
| ^
|
||
|
|
||
|
error: aborting due to 2 previous errors
|
||
|
|
||
|
For more information about this error, try `rustc --explain E0080`.
|