]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/const-eval/union-ub.stderr
New upstream version 1.52.1+dfsg1
[rustc.git] / src / test / ui / consts / const-eval / union-ub.stderr
CommitLineData
a1dfa0c6 1error[E0080]: it is undefined behavior to use this value
f035d41b 2 --> $DIR/union-ub.rs:32:1
8faf50e0
XL
3 |
4LL | const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool};
f9f354fc 5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x2a, but expected a boolean
8faf50e0 6 |
e1599b0c 7 = 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.
8faf50e0 8
f035d41b
XL
9error[E0080]: it is undefined behavior to use this value
10 --> $DIR/union-ub.rs:34:1
11 |
12LL | const UNINIT_BOOL: bool = unsafe { DummyUnion { unit: () }.bool};
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected a boolean
14 |
15 = 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.
16
17error: aborting due to 2 previous errors
8faf50e0
XL
18
19For more information about this error, try `rustc --explain E0080`.