]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/ub-uninhabit.stderr
Update const_forget.rs
[rust.git] / src / test / ui / consts / const-eval / ub-uninhabit.stderr
1 error[E0080]: it is undefined behavior to use this value
2   --> $DIR/ub-uninhabit.rs:15:1
3    |
4 LL | const BAD_BAD_BAD: Bar = unsafe { (TransmuteUnion::<(), Bar> { a: () }).b };
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of an uninhabited type
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
9 error[E0080]: it is undefined behavior to use this value
10   --> $DIR/ub-uninhabit.rs:18:1
11    |
12 LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
13    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of an uninhabited type at .<deref>
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[E0080]: it is undefined behavior to use this value
18   --> $DIR/ub-uninhabit.rs:21:1
19    |
20 LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { (TransmuteUnion::<(), [Bar; 1]> { a: () }).b };
21    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of an uninhabited type
22    |
23    = 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.
24
25 error: aborting due to 3 previous errors
26
27 For more information about this error, try `rustc --explain E0080`.