rust/tests/ui/consts/const_refs_to_static_fail_i...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
854 B
Plaintext
Raw Normal View History

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`.