fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0080]: evaluation of constant value failed 2 --> $DIR/ub-uninhabit.rs:19:35 3 | 4LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init }; 5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type `Bar` 6 7error[E0080]: it is undefined behavior to use this value 8 --> $DIR/ub-uninhabit.rs:23:1 9 | 10LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) }; 11 | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar 12 | 13 = 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. 14 = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) { 15 HEX_DUMP 16 } 17 18error[E0080]: evaluation of constant value failed 19 --> $DIR/ub-uninhabit.rs:27:42 20 | 21LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init }; 22 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type `Bar` 23 24error[E0080]: evaluation of constant value failed 25 --> $DIR/ub-uninhabit.rs:35:16 26 | 27LL | let _val = intrinsics::read_via_copy(ptr); 28 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of the never type `!` 29 30error: aborting due to 4 previous errors 31 32For more information about this error, try `rustc --explain E0080`.