|
1 | 1 | error[E0080]: it is undefined behavior to use this value
|
2 |
| - --> $DIR/ub-enum.rs:23:1 |
| 2 | + --> $DIR/ub-enum.rs:24:1 |
3 | 3 | |
|
4 | 4 | LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
|
5 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 1, but expected a valid enum discriminant |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x00000001, but expected a valid enum discriminant |
6 | 6 | |
|
7 | 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 | 8 |
|
9 | 9 | error[E0080]: it is undefined behavior to use this value
|
10 |
| - --> $DIR/ub-enum.rs:26:1 |
| 10 | + --> $DIR/ub-enum.rs:27:1 |
11 | 11 | |
|
12 | 12 | LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
|
13 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer at .<enum-tag>, but expected initialized plain (non-pointer) bytes |
| 13 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc8+0x0 at .<enum-tag>, but expected initialized plain (non-pointer) bytes |
14 | 14 | |
|
15 | 15 | = 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.
|
16 | 16 |
|
17 | 17 | error[E0080]: it is undefined behavior to use this value
|
18 |
| - --> $DIR/ub-enum.rs:29:1 |
| 18 | + --> $DIR/ub-enum.rs:30:1 |
19 | 19 | |
|
20 | 20 | LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
|
21 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer at .0.<enum-tag>, but expected initialized plain (non-pointer) bytes |
| 21 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc13+0x0 at .0.<enum-tag>, but expected initialized plain (non-pointer) bytes |
22 | 22 | |
|
23 | 23 | = 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.
|
24 | 24 |
|
25 | 25 | error[E0080]: it is undefined behavior to use this value
|
26 |
| - --> $DIR/ub-enum.rs:41:1 |
| 26 | + --> $DIR/ub-enum.rs:42:1 |
27 | 27 | |
|
28 | 28 | LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
|
29 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected a valid enum discriminant |
| 29 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x00000000, but expected a valid enum discriminant |
30 | 30 | |
|
31 | 31 | = 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.
|
32 | 32 |
|
33 | 33 | error[E0080]: it is undefined behavior to use this value
|
34 |
| - --> $DIR/ub-enum.rs:43:1 |
| 34 | + --> $DIR/ub-enum.rs:44:1 |
35 | 35 | |
|
36 | 36 | LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
|
37 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer at .<enum-tag>, but expected initialized plain (non-pointer) bytes |
| 37 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc20+0x0 at .<enum-tag>, but expected initialized plain (non-pointer) bytes |
38 | 38 | |
|
39 | 39 | = 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.
|
40 | 40 |
|
41 | 41 | error[E0080]: it is undefined behavior to use this value
|
42 |
| - --> $DIR/ub-enum.rs:46:1 |
| 42 | + --> $DIR/ub-enum.rs:47:1 |
43 | 43 | |
|
44 | 44 | LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
|
45 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer at .0.<enum-tag>, but expected initialized plain (non-pointer) bytes |
| 45 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc25+0x0 at .0.<enum-tag>, but expected initialized plain (non-pointer) bytes |
46 | 46 | |
|
47 | 47 | = 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.
|
48 | 48 |
|
49 | 49 | error[E0080]: it is undefined behavior to use this value
|
50 |
| - --> $DIR/ub-enum.rs:55:1 |
| 50 | + --> $DIR/ub-enum.rs:56:1 |
51 | 51 | |
|
52 | 52 | LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
|
53 | 53 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes at .<enum-tag>, but expected initialized plain (non-pointer) bytes
|
54 | 54 | |
|
55 | 55 | = 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.
|
56 | 56 |
|
57 | 57 | error[E0080]: it is undefined behavior to use this value
|
58 |
| - --> $DIR/ub-enum.rs:59:1 |
| 58 | + --> $DIR/ub-enum.rs:60:1 |
59 | 59 | |
|
60 | 60 | LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
|
61 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer at .<enum-tag>, but expected initialized plain (non-pointer) bytes |
| 61 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc32+0x0 at .<enum-tag>, but expected initialized plain (non-pointer) bytes |
62 | 62 | |
|
63 | 63 | = 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.
|
64 | 64 |
|
65 | 65 | error[E0080]: it is undefined behavior to use this value
|
66 |
| - --> $DIR/ub-enum.rs:76:1 |
| 66 | + --> $DIR/ub-enum.rs:77:1 |
67 | 67 | |
|
68 | 68 | LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
|
69 | 69 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of the never type `!` at .<enum-variant(B)>.0
|
70 | 70 | |
|
71 | 71 | = 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.
|
72 | 72 |
|
73 | 73 | error[E0080]: it is undefined behavior to use this value
|
74 |
| - --> $DIR/ub-enum.rs:78:1 |
| 74 | + --> $DIR/ub-enum.rs:79:1 |
75 | 75 | |
|
76 | 76 | LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
|
77 | 77 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Never at .<enum-variant(D)>.0
|
78 | 78 | |
|
79 | 79 | = 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.
|
80 | 80 |
|
81 | 81 | error[E0080]: it is undefined behavior to use this value
|
82 |
| - --> $DIR/ub-enum.rs:86:1 |
| 82 | + --> $DIR/ub-enum.rs:87:1 |
83 | 83 | |
|
84 | 84 | LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
|
85 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 4294967295 at .<enum-variant(Some)>.0.1, but expected a valid unicode codepoint |
| 85 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0xffffffff at .<enum-variant(Some)>.0.1, but expected a valid unicode codepoint |
86 | 86 | |
|
87 | 87 | = 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.
|
88 | 88 |
|
89 | 89 | error[E0080]: it is undefined behavior to use this value
|
90 |
| - --> $DIR/ub-enum.rs:90:1 |
| 90 | + --> $DIR/ub-enum.rs:91:1 |
91 | 91 | |
|
92 | 92 | LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(1u64) };
|
93 | 93 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of the never type `!` at .<enum-variant(Err)>.0.1
|
94 | 94 | |
|
95 | 95 | = 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.
|
96 | 96 |
|
97 | 97 | error[E0080]: it is undefined behavior to use this value
|
98 |
| - --> $DIR/ub-enum.rs:92:1 |
| 98 | + --> $DIR/ub-enum.rs:93:1 |
99 | 99 | |
|
100 | 100 | LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(1u64) };
|
101 | 101 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Never at .<enum-variant(Err)>.0.1
|
|
0 commit comments