Skip to content

Commit b18a2eb

Browse files
ecnelisesMark-Simulacrum
authored andcommitted
Support endianness mark in test case check files
Add new endianness mark ('be' or 'le') into stderr file suffixes, which helps when memory layout dumps in error messages are different.
1 parent b12b836 commit b18a2eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1890
-438
lines changed

src/test/ui/const-ptr/forbidden_slices.32bit.stderr renamed to src/test/ui/const-ptr/forbidden_slices.32bit.be.stderr

Lines changed: 93 additions & 126 deletions
Large diffs are not rendered by default.

src/test/ui/const-ptr/forbidden_slices.64bit.stderr renamed to src/test/ui/const-ptr/forbidden_slices.64bit.be.stderr

Lines changed: 93 additions & 126 deletions
Large diffs are not rendered by default.

src/test/ui/const-ptr/forbidden_slices.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// stderr-per-bitwidth
2+
// stderr-per-endianness
23
// normalize-stderr-test "alloc[0-9]+" -> "ALLOC_ID"
34
// normalize-stderr-test "a[0-9]+\+0x" -> "A_ID+0x"
45
// error-pattern: could not evaluate static initializer
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
error[E0080]: it is undefined behavior to use this value
2+
--> $DIR/ub-enum.rs:25:1
3+
|
4+
LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
5+
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x00000001, but expected a valid enum tag
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: 4, align: 4) {
9+
00 00 00 01 │ ....
10+
}
11+
12+
error[E0080]: evaluation of constant value failed
13+
--> $DIR/ub-enum.rs:28:1
14+
|
15+
LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
17+
|
18+
= help: this code performed an operation that depends on the underlying bytes representing a pointer
19+
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
20+
21+
error[E0080]: evaluation of constant value failed
22+
--> $DIR/ub-enum.rs:31:1
23+
|
24+
LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
25+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
26+
|
27+
= help: this code performed an operation that depends on the underlying bytes representing a pointer
28+
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
29+
30+
error[E0080]: it is undefined behavior to use this value
31+
--> $DIR/ub-enum.rs:43:1
32+
|
33+
LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
34+
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x00000000, but expected a valid enum tag
35+
|
36+
= 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.
37+
= note: the raw bytes of the constant (size: 4, align: 4) {
38+
00 00 00 00 │ ....
39+
}
40+
41+
error[E0080]: evaluation of constant value failed
42+
--> $DIR/ub-enum.rs:45:1
43+
|
44+
LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
45+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
46+
|
47+
= help: this code performed an operation that depends on the underlying bytes representing a pointer
48+
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
49+
50+
error[E0080]: evaluation of constant value failed
51+
--> $DIR/ub-enum.rs:48:1
52+
|
53+
LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
54+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
55+
|
56+
= help: this code performed an operation that depends on the underlying bytes representing a pointer
57+
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
58+
59+
error[E0080]: evaluation of constant value failed
60+
--> $DIR/ub-enum.rs:57:42
61+
|
62+
LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
63+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
64+
65+
error[E0080]: evaluation of constant value failed
66+
--> $DIR/ub-enum.rs:62:1
67+
|
68+
LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
69+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
70+
|
71+
= help: this code performed an operation that depends on the underlying bytes representing a pointer
72+
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
73+
74+
error[E0080]: it is undefined behavior to use this value
75+
--> $DIR/ub-enum.rs:79:1
76+
|
77+
LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
78+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(B)>.0: encountered a value of the never type `!`
79+
|
80+
= 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.
81+
= note: the raw bytes of the constant (size: 1, align: 1) {
82+
01 │ .
83+
}
84+
85+
error[E0080]: it is undefined behavior to use this value
86+
--> $DIR/ub-enum.rs:81:1
87+
|
88+
LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
89+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
90+
|
91+
= 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.
92+
= note: the raw bytes of the constant (size: 1, align: 1) {
93+
03 │ .
94+
}
95+
96+
error[E0080]: it is undefined behavior to use this value
97+
--> $DIR/ub-enum.rs:89:1
98+
|
99+
LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
100+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
101+
|
102+
= 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.
103+
= note: the raw bytes of the constant (size: 8, align: 4) {
104+
00 00 00 78 ff ff ff ff │ x.......
105+
}
106+
107+
error[E0080]: evaluation of constant value failed
108+
--> $DIR/ub-enum.rs:94:77
109+
|
110+
LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) };
111+
| ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
112+
113+
error[E0080]: evaluation of constant value failed
114+
--> $DIR/ub-enum.rs:96:77
115+
|
116+
LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) };
117+
| ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
118+
119+
error: aborting due to 13 previous errors
120+
121+
For more information about this error, try `rustc --explain E0080`.

src/test/ui/consts/const-eval/ub-enum.32bit.stderr renamed to src/test/ui/consts/const-eval/ub-enum.32bit.le.stderr

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0080]: it is undefined behavior to use this value
2-
--> $DIR/ub-enum.rs:24:1
2+
--> $DIR/ub-enum.rs:25:1
33
|
44
LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
55
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x00000001, but expected a valid enum tag
@@ -10,7 +10,7 @@ LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
1010
}
1111

1212
error[E0080]: evaluation of constant value failed
13-
--> $DIR/ub-enum.rs:27:1
13+
--> $DIR/ub-enum.rs:28:1
1414
|
1515
LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
@@ -19,7 +19,7 @@ LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
1919
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
2020

2121
error[E0080]: evaluation of constant value failed
22-
--> $DIR/ub-enum.rs:30:1
22+
--> $DIR/ub-enum.rs:31:1
2323
|
2424
LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
@@ -28,7 +28,7 @@ LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
2828
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
2929

3030
error[E0080]: it is undefined behavior to use this value
31-
--> $DIR/ub-enum.rs:42:1
31+
--> $DIR/ub-enum.rs:43:1
3232
|
3333
LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
3434
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x00000000, but expected a valid enum tag
@@ -39,7 +39,7 @@ LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
3939
}
4040

4141
error[E0080]: evaluation of constant value failed
42-
--> $DIR/ub-enum.rs:44:1
42+
--> $DIR/ub-enum.rs:45:1
4343
|
4444
LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
4545
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
@@ -48,7 +48,7 @@ LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
4848
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
4949

5050
error[E0080]: evaluation of constant value failed
51-
--> $DIR/ub-enum.rs:47:1
51+
--> $DIR/ub-enum.rs:48:1
5252
|
5353
LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
5454
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
@@ -57,13 +57,13 @@ LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
5757
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
5858

5959
error[E0080]: evaluation of constant value failed
60-
--> $DIR/ub-enum.rs:56:42
60+
--> $DIR/ub-enum.rs:57:42
6161
|
6262
LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
6363
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
6464

6565
error[E0080]: evaluation of constant value failed
66-
--> $DIR/ub-enum.rs:61:1
66+
--> $DIR/ub-enum.rs:62:1
6767
|
6868
LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
6969
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
@@ -72,7 +72,7 @@ LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
7272
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
7373

7474
error[E0080]: it is undefined behavior to use this value
75-
--> $DIR/ub-enum.rs:78:1
75+
--> $DIR/ub-enum.rs:79:1
7676
|
7777
LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
7878
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(B)>.0: encountered a value of the never type `!`
@@ -83,7 +83,7 @@ LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute
8383
}
8484

8585
error[E0080]: it is undefined behavior to use this value
86-
--> $DIR/ub-enum.rs:80:1
86+
--> $DIR/ub-enum.rs:81:1
8787
|
8888
LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
8989
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
@@ -94,7 +94,7 @@ LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute
9494
}
9595

9696
error[E0080]: it is undefined behavior to use this value
97-
--> $DIR/ub-enum.rs:88:1
97+
--> $DIR/ub-enum.rs:89:1
9898
|
9999
LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
100100
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
@@ -105,13 +105,13 @@ LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::tran
105105
}
106106

107107
error[E0080]: evaluation of constant value failed
108-
--> $DIR/ub-enum.rs:93:77
108+
--> $DIR/ub-enum.rs:94:77
109109
|
110110
LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) };
111111
| ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
112112

113113
error[E0080]: evaluation of constant value failed
114-
--> $DIR/ub-enum.rs:95:77
114+
--> $DIR/ub-enum.rs:96:77
115115
|
116116
LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) };
117117
| ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
error[E0080]: it is undefined behavior to use this value
2+
--> $DIR/ub-enum.rs:25:1
3+
|
4+
LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
5+
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x0000000000000001, but expected a valid enum tag
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+
00 00 00 00 00 00 00 01 │ ........
10+
}
11+
12+
error[E0080]: evaluation of constant value failed
13+
--> $DIR/ub-enum.rs:28:1
14+
|
15+
LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
17+
|
18+
= help: this code performed an operation that depends on the underlying bytes representing a pointer
19+
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
20+
21+
error[E0080]: evaluation of constant value failed
22+
--> $DIR/ub-enum.rs:31:1
23+
|
24+
LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
25+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
26+
|
27+
= help: this code performed an operation that depends on the underlying bytes representing a pointer
28+
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
29+
30+
error[E0080]: it is undefined behavior to use this value
31+
--> $DIR/ub-enum.rs:43:1
32+
|
33+
LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
34+
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x0000000000000000, but expected a valid enum tag
35+
|
36+
= 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.
37+
= note: the raw bytes of the constant (size: 8, align: 8) {
38+
00 00 00 00 00 00 00 00 │ ........
39+
}
40+
41+
error[E0080]: evaluation of constant value failed
42+
--> $DIR/ub-enum.rs:45:1
43+
|
44+
LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
45+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
46+
|
47+
= help: this code performed an operation that depends on the underlying bytes representing a pointer
48+
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
49+
50+
error[E0080]: evaluation of constant value failed
51+
--> $DIR/ub-enum.rs:48:1
52+
|
53+
LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
54+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
55+
|
56+
= help: this code performed an operation that depends on the underlying bytes representing a pointer
57+
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
58+
59+
error[E0080]: evaluation of constant value failed
60+
--> $DIR/ub-enum.rs:57:42
61+
|
62+
LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
63+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
64+
65+
error[E0080]: evaluation of constant value failed
66+
--> $DIR/ub-enum.rs:62:1
67+
|
68+
LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
69+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
70+
|
71+
= help: this code performed an operation that depends on the underlying bytes representing a pointer
72+
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
73+
74+
error[E0080]: it is undefined behavior to use this value
75+
--> $DIR/ub-enum.rs:79:1
76+
|
77+
LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
78+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(B)>.0: encountered a value of the never type `!`
79+
|
80+
= 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.
81+
= note: the raw bytes of the constant (size: 1, align: 1) {
82+
01 │ .
83+
}
84+
85+
error[E0080]: it is undefined behavior to use this value
86+
--> $DIR/ub-enum.rs:81:1
87+
|
88+
LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
89+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
90+
|
91+
= 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.
92+
= note: the raw bytes of the constant (size: 1, align: 1) {
93+
03 │ .
94+
}
95+
96+
error[E0080]: it is undefined behavior to use this value
97+
--> $DIR/ub-enum.rs:89:1
98+
|
99+
LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
100+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
101+
|
102+
= 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.
103+
= note: the raw bytes of the constant (size: 8, align: 4) {
104+
00 00 00 78 ff ff ff ff │ x.......
105+
}
106+
107+
error[E0080]: evaluation of constant value failed
108+
--> $DIR/ub-enum.rs:94:77
109+
|
110+
LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) };
111+
| ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
112+
113+
error[E0080]: evaluation of constant value failed
114+
--> $DIR/ub-enum.rs:96:77
115+
|
116+
LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) };
117+
| ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
118+
119+
error: aborting due to 13 previous errors
120+
121+
For more information about this error, try `rustc --explain E0080`.

0 commit comments

Comments
 (0)