rust/src/test/ui/consts/const-eval/ub-uninhabit.32bit.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
2.0 KiB
Plaintext
Raw Normal View History

2021-03-31 04:33:45 -05:00
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-uninhabit.rs:15:1
|
LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Bar
|
= 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.
= note: the raw bytes of the constant (size: 0, align: 1) {}
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-uninhabit.rs:18:1
|
LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
2022-05-17 12:05:14 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a reference pointing to uninhabited type Bar
2021-03-31 04:33:45 -05:00
|
= 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.
= note: the raw bytes of the constant (size: 4, align: 4) {
01 00 00 00 │ ....
}
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-uninhabit.rs:21:1
|
LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init };
2021-06-13 16:16:00 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at [0]: encountered a value of uninhabited type Bar
2021-03-31 04:33:45 -05:00
|
= 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.
= note: the raw bytes of the constant (size: 0, align: 1) {}
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0080`.