]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/union-ice.stderr
Rollup merge of #83634 - JohnTitor:proc-macro-ice, r=varkor
[rust.git] / src / test / ui / consts / const-eval / union-ice.stderr
1 error[E0080]: it is undefined behavior to use this value
2   --> $DIR/union-ice.rs:15:1
3    |
4 LL | const FIELD3: Field3 = unsafe { UNION.field3 };
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
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: 8, align: 8) {
9                __ __ __ __ __ __ __ __                         │ ░░░░░░░░
10            }
11
12 error[E0080]: it is undefined behavior to use this value
13   --> $DIR/union-ice.rs:17:1
14    |
15 LL | / const FIELD_PATH: Struct = Struct {
16 LL | |     a: 42,
17 LL | |     b: unsafe { UNION.field3 },
18 LL | | };
19    | |__^ type validation failed: encountered uninitialized bytes at .b, but expected initialized plain (non-pointer) bytes
20    |
21    = 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.
22    = note: the raw bytes of the constant (size: 16, align: 8) {
23                __ __ __ __ __ __ __ __ 2a __ __ __ __ __ __ __ │ ░░░░░░░░*░░░░░░░
24            }
25
26 error[E0080]: it is undefined behavior to use this value
27   --> $DIR/union-ice.rs:27:1
28    |
29 LL | / const FIELD_PATH2: Struct2 = Struct2 {
30 LL | |     b: [
31 LL | |         21,
32 LL | |         unsafe { UNION.field3 },
33 ...  |
34 LL | |     a: 42,
35 LL | | };
36    | |__^ type validation failed: encountered uninitialized bytes at .b[1]
37    |
38    = 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.
39    = note: the raw bytes of the constant (size: 40, align: 8) {
40                0x00 │ 15 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ │ ........░░░░░░░░
41                0x10 │ 17 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00 │ ................
42                0x20 │ 2a __ __ __ __ __ __ __                         │ *░░░░░░░
43            }
44
45 error: aborting due to 3 previous errors
46
47 For more information about this error, try `rustc --explain E0080`.