]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/union-ub.stderr
Report const eval error inside the query
[rust.git] / src / test / ui / consts / const-eval / union-ub.stderr
1 error[E0080]: it is undefined behavior to use this value
2   --> $DIR/union-ub.rs:36:1
3    |
4 LL | const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool};
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 42, but expected something in the range 0..=1
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 rust compiler repository if you believe it should not be considered undefined behavior
8
9 error: aborting due to previous error
10
11 For more information about this error, try `rustc --explain E0080`.