]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/ub-uninhabit.32bit.stderr
Rollup merge of #83634 - JohnTitor:proc-macro-ice, r=varkor
[rust.git] / src / test / ui / consts / const-eval / ub-uninhabit.32bit.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 { MaybeUninit { uninit: () }.init };
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Bar
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    = note: the raw bytes of the constant (size: 0, align: 1) {}
9
10 error[E0080]: it is undefined behavior to use this value
11   --> $DIR/ub-uninhabit.rs:18:1
12    |
13 LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
14    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Bar at .<deref>
15    |
16    = 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.
17    = note: the raw bytes of the constant (size: 4, align: 4) {
18                01 00 00 00                                     │ ....
19            }
20
21 error[E0080]: it is undefined behavior to use this value
22   --> $DIR/ub-uninhabit.rs:21:1
23    |
24 LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init };
25    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Bar at [0]
26    |
27    = 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.
28    = note: the raw bytes of the constant (size: 0, align: 1) {}
29
30 error: aborting due to 3 previous errors
31
32 For more information about this error, try `rustc --explain E0080`.