]>
Commit | Line | Data |
---|---|---|
a1dfa0c6 | 1 | error[E0080]: it is undefined behavior to use this value |
f035d41b | 2 | --> $DIR/union-ub.rs:32:1 |
8faf50e0 XL |
3 | | |
4 | LL | 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 |
9 | error[E0080]: it is undefined behavior to use this value |
10 | --> $DIR/union-ub.rs:34:1 | |
11 | | | |
12 | LL | 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 | ||
17 | error: aborting due to 2 previous errors | |
8faf50e0 XL |
18 | |
19 | For more information about this error, try `rustc --explain E0080`. |