1
1
error[E0080]: evaluation of constant value failed
2
- --> $DIR/ub-uninhabit.rs:16 :35
2
+ --> $DIR/ub-uninhabit.rs:19 :35
3
3
|
4
4
LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type `Bar`
6
6
7
7
error[E0080]: it is undefined behavior to use this value
8
- --> $DIR/ub-uninhabit.rs:19 :1
8
+ --> $DIR/ub-uninhabit.rs:23 :1
9
9
|
10
10
LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
11
11
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar
@@ -16,11 +16,17 @@ LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
16
16
}
17
17
18
18
error[E0080]: evaluation of constant value failed
19
- --> $DIR/ub-uninhabit.rs:22 :42
19
+ --> $DIR/ub-uninhabit.rs:27 :42
20
20
|
21
21
LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init };
22
22
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type `Bar`
23
23
24
- error: aborting due to 3 previous errors
24
+ error[E0080]: evaluation of constant value failed
25
+ --> $DIR/ub-uninhabit.rs:35:16
26
+ |
27
+ LL | let _val = intrinsics::read_via_copy(ptr);
28
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of the never type `!`
29
+
30
+ error: aborting due to 4 previous errors
25
31
26
32
For more information about this error, try `rustc --explain E0080`.
0 commit comments