|
1 |
| -error: this constant cannot be used |
2 |
| - --> $DIR/ub-uninhabit.rs:18:1 |
| 1 | +error[E0080]: this constant likely exhibits undefined behavior |
| 2 | + --> $DIR/ub-uninhabit.rs:13:1 |
3 | 3 | |
|
4 |
| -LL | const BAD_BAD_BAD: Bar = unsafe { mem::transmute(()) }; |
5 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------------------^^^ |
6 |
| - | | |
7 |
| - | entered unreachable code |
| 4 | +LL | const BAD_BAD_BAD: Bar = unsafe { (TransmuteUnion::<(), Bar> { a: () }).b }; |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of an uninhabited type |
8 | 6 | |
|
9 |
| - = note: #[deny(const_err)] on by default |
| 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 |
10 | 8 |
|
11 | 9 | error[E0080]: this constant likely exhibits undefined behavior
|
12 |
| - --> $DIR/ub-uninhabit.rs:21:1 |
| 10 | + --> $DIR/ub-uninhabit.rs:16:1 |
13 | 11 | |
|
14 | 12 | LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
|
15 | 13 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of an uninhabited type at .<deref>
|
16 | 14 | |
|
17 | 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 rust compiler repository if you believe it should not be considered undefined behavior
|
18 | 16 |
|
19 |
| -error: this constant cannot be used |
20 |
| - --> $DIR/ub-uninhabit.rs:24:1 |
| 17 | +error[E0080]: this constant likely exhibits undefined behavior |
| 18 | + --> $DIR/ub-uninhabit.rs:19:1 |
21 | 19 | |
|
22 |
| -LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { mem::transmute(()) }; |
23 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------------------^^^ |
24 |
| - | | |
25 |
| - | entered unreachable code |
| 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 rust compiler repository if you believe it should not be considered undefined behavior |
26 | 24 |
|
27 | 25 | error: aborting due to 3 previous errors
|
28 | 26 |
|
|
0 commit comments