]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/union-ub.64bit.stderr
Rollup merge of #80733 - steffahn:prettify_pin_links, r=jyn514
[rust.git] / src / test / ui / consts / const-eval / union-ub.64bit.stderr
1 error[E0080]: it is undefined behavior to use this value
2   --> $DIR/union-ub.rs:33:1
3    |
4 LL | const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool};
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x2a, but expected a boolean
6    |
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.
8    = note: the raw bytes of the constant (size: 1, align: 1) {
9                2a                                              │ *
10            }
11
12 error[E0080]: it is undefined behavior to use this value
13   --> $DIR/union-ub.rs:35:1
14    |
15 LL | const UNINIT_BOOL: bool = unsafe { DummyUnion { unit: () }.bool};
16    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected a boolean
17    |
18    = 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.
19    = note: the raw bytes of the constant (size: 1, align: 1) {
20                __                                              │ ░
21            }
22
23 error: aborting due to 2 previous errors
24
25 For more information about this error, try `rustc --explain E0080`.