Skip to content

Commit f80b9ac

Browse files
committed
Add 32bit.stderr files.
1 parent 091433d commit f80b9ac

24 files changed

+1443
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/invalid-patterns.rs:29:21
3+
|
4+
LL | get_flag::<false, 0xFF>();
5+
| ^^^^ expected `char`, found `u8`
6+
7+
error[E0308]: mismatched types
8+
--> $DIR/invalid-patterns.rs:31:14
9+
|
10+
LL | get_flag::<7, 'c'>();
11+
| ^ expected `bool`, found integer
12+
13+
error[E0308]: mismatched types
14+
--> $DIR/invalid-patterns.rs:33:14
15+
|
16+
LL | get_flag::<42, 0x5ad>();
17+
| ^^ expected `bool`, found integer
18+
19+
error[E0308]: mismatched types
20+
--> $DIR/invalid-patterns.rs:33:18
21+
|
22+
LL | get_flag::<42, 0x5ad>();
23+
| ^^^^^ expected `char`, found `u8`
24+
25+
error[E0080]: it is undefined behavior to use this value
26+
--> $DIR/invalid-patterns.rs:38:21
27+
|
28+
LL | get_flag::<false, { unsafe { char_raw.character } }>();
29+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
30+
|
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+
= note: the raw bytes of the constant (size: 4, align: 4) {
33+
__ __ __ __ │ ░░░░
34+
}
35+
36+
error[E0080]: it is undefined behavior to use this value
37+
--> $DIR/invalid-patterns.rs:40:14
38+
|
39+
LL | get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
40+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x42, but expected a boolean
41+
|
42+
= 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.
43+
= note: the raw bytes of the constant (size: 1, align: 1) {
44+
42 │ B
45+
}
46+
47+
error[E0080]: it is undefined behavior to use this value
48+
--> $DIR/invalid-patterns.rs:42:14
49+
|
50+
LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
51+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x42, but expected a boolean
52+
|
53+
= 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.
54+
= note: the raw bytes of the constant (size: 1, align: 1) {
55+
42 │ B
56+
}
57+
58+
error[E0080]: it is undefined behavior to use this value
59+
--> $DIR/invalid-patterns.rs:42:47
60+
|
61+
LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
62+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
63+
|
64+
= 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.
65+
= note: the raw bytes of the constant (size: 4, align: 4) {
66+
__ __ __ __ │ ░░░░
67+
}
68+
69+
error: aborting due to 8 previous errors
70+
71+
Some errors have detailed explanations: E0080, E0308.
72+
For more information about an error, try `rustc --explain E0080`.
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0080]: it is undefined behavior to use this value
2+
--> $DIR/const-err4.rs:9:11
3+
|
4+
LL | Boo = [unsafe { Foo { b: () }.a }; 4][3],
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: 4, align: 4) {
9+
__ __ __ __ │ ░░░░
10+
}
11+
12+
error: aborting due to previous error
13+
14+
For more information about this error, try `rustc --explain E0080`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0080]: it is undefined behavior to use this value
2+
--> $DIR/alloc_intrinsic_uninit.rs:9:1
3+
|
4+
LL | const BAR: &i32 = unsafe { &*(intrinsics::const_allocate(4, 4) as *mut i32) };
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes at .<deref>, 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: 4, align: 4) {
9+
╾─alloc1──╼ │ ╾──╼
10+
}
11+
12+
error: aborting due to previous error
13+
14+
For more information about this error, try `rustc --explain E0080`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
error[E0080]: it is undefined behavior to use this value
2+
--> $DIR/ref_to_int_match.rs:26:1
3+
|
4+
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc2, 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: 4, align: 4) {
9+
╾─alloc2──╼ │ ╾──╼
10+
}
11+
12+
error: could not evaluate constant pattern
13+
--> $DIR/ref_to_int_match.rs:8:14
14+
|
15+
LL | 10..=BAR => {},
16+
| ^^^
17+
18+
error: could not evaluate constant pattern
19+
--> $DIR/ref_to_int_match.rs:8:14
20+
|
21+
LL | 10..=BAR => {},
22+
| ^^^
23+
24+
error: aborting due to 3 previous errors
25+
26+
For more information about this error, try `rustc --explain E0080`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0080]: it is undefined behavior to use this value
2+
--> $DIR/transmute-const.rs:4:1
3+
|
4+
LL | static FOO: bool = unsafe { mem::transmute(3u8) };
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x03, but expected a boolean
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: 1, align: 1) {
9+
03 │ .
10+
}
11+
12+
error: aborting due to previous error
13+
14+
For more information about this error, try `rustc --explain E0080`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
error[E0080]: it is undefined behavior to use this value
2+
--> $DIR/ub-enum.rs:24:1
3+
|
4+
LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x00000001 at .<enum-tag>, 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+
01 00 00 00 │ ....
10+
}
11+
12+
error[E0080]: it is undefined behavior to use this value
13+
--> $DIR/ub-enum.rs:27:1
14+
|
15+
LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc8 at .<enum-tag>, but expected initialized plain (non-pointer) bytes
17+
|
18+
= 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.
19+
= note: the raw bytes of the constant (size: 4, align: 4) {
20+
╾─alloc8──╼ │ ╾──╼
21+
}
22+
23+
error[E0080]: it is undefined behavior to use this value
24+
--> $DIR/ub-enum.rs:30:1
25+
|
26+
LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
27+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc12 at .0.<enum-tag>, but expected initialized plain (non-pointer) bytes
28+
|
29+
= 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.
30+
= note: the raw bytes of the constant (size: 4, align: 4) {
31+
╾─alloc12─╼ │ ╾──╼
32+
}
33+
34+
error[E0080]: it is undefined behavior to use this value
35+
--> $DIR/ub-enum.rs:42:1
36+
|
37+
LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
38+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x00000000 at .<enum-tag>, but expected a valid enum tag
39+
|
40+
= 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.
41+
= note: the raw bytes of the constant (size: 4, align: 4) {
42+
00 00 00 00 │ ....
43+
}
44+
45+
error[E0080]: it is undefined behavior to use this value
46+
--> $DIR/ub-enum.rs:44:1
47+
|
48+
LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
49+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc18 at .<enum-tag>, but expected initialized plain (non-pointer) bytes
50+
|
51+
= 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.
52+
= note: the raw bytes of the constant (size: 4, align: 4) {
53+
╾─alloc18─╼ │ ╾──╼
54+
}
55+
56+
error[E0080]: it is undefined behavior to use this value
57+
--> $DIR/ub-enum.rs:47:1
58+
|
59+
LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
60+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc22 at .0.<enum-tag>, but expected initialized plain (non-pointer) bytes
61+
|
62+
= 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.
63+
= note: the raw bytes of the constant (size: 4, align: 4) {
64+
╾─alloc22─╼ │ ╾──╼
65+
}
66+
67+
error[E0080]: it is undefined behavior to use this value
68+
--> $DIR/ub-enum.rs:56:1
69+
|
70+
LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
71+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes at .<enum-tag>, but expected initialized plain (non-pointer) bytes
72+
|
73+
= 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.
74+
= note: the raw bytes of the constant (size: 4, align: 4) {
75+
__ __ __ __ │ ░░░░
76+
}
77+
78+
error[E0080]: it is undefined behavior to use this value
79+
--> $DIR/ub-enum.rs:60:1
80+
|
81+
LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
82+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc28 at .<enum-tag>, but expected initialized plain (non-pointer) bytes
83+
|
84+
= 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.
85+
= note: the raw bytes of the constant (size: 4, align: 4) {
86+
╾─alloc28─╼ │ ╾──╼
87+
}
88+
89+
error[E0080]: it is undefined behavior to use this value
90+
--> $DIR/ub-enum.rs:77:1
91+
|
92+
LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
93+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of the never type `!` at .<enum-variant(B)>.0
94+
|
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+
= note: the raw bytes of the constant (size: 1, align: 1) {
97+
01 │ .
98+
}
99+
100+
error[E0080]: it is undefined behavior to use this value
101+
--> $DIR/ub-enum.rs:79:1
102+
|
103+
LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
104+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Never at .<enum-variant(D)>.0
105+
|
106+
= 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.
107+
= note: the raw bytes of the constant (size: 1, align: 1) {
108+
03 │ .
109+
}
110+
111+
error[E0080]: it is undefined behavior to use this value
112+
--> $DIR/ub-enum.rs:87:1
113+
|
114+
LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
115+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0xffffffff at .<enum-variant(Some)>.0.1, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
116+
|
117+
= 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.
118+
= note: the raw bytes of the constant (size: 8, align: 4) {
119+
78 00 00 00 ff ff ff ff │ x.......
120+
}
121+
122+
error[E0080]: it is undefined behavior to use this value
123+
--> $DIR/ub-enum.rs:92:1
124+
|
125+
LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) };
126+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Never at .<enum-variant(Ok)>.0.1
127+
|
128+
= 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.
129+
= note: the raw bytes of the constant (size: 8, align: 4) {
130+
00 00 00 00 00 00 00 00 │ ........
131+
}
132+
133+
error[E0080]: it is undefined behavior to use this value
134+
--> $DIR/ub-enum.rs:94:1
135+
|
136+
LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) };
137+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of the never type `!` at .<enum-variant(Ok)>.0.1
138+
|
139+
= 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.
140+
= note: the raw bytes of the constant (size: 8, align: 4) {
141+
00 00 00 00 00 00 00 00 │ ........
142+
}
143+
144+
error: aborting due to 13 previous errors
145+
146+
For more information about this error, try `rustc --explain E0080`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
error[E0080]: it is undefined behavior to use this value
2+
--> $DIR/ub-int-array.rs:14:1
3+
|
4+
LL | / const UNINIT_INT_0: [u32; 3] = unsafe {
5+
LL | |
6+
LL | |
7+
LL | | [
8+
... |
9+
LL | | ]
10+
LL | | };
11+
| |__^ type validation failed: encountered uninitialized bytes at [0]
12+
|
13+
= 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.
14+
= note: the raw bytes of the constant (size: 12, align: 4) {
15+
__ __ __ __ 01 00 00 00 02 00 00 00 │ ░░░░........
16+
}
17+
18+
error[E0080]: it is undefined behavior to use this value
19+
--> $DIR/ub-int-array.rs:23:1
20+
|
21+
LL | / const UNINIT_INT_1: [u32; 3] = unsafe {
22+
LL | |
23+
LL | |
24+
LL | | mem::transmute(
25+
... |
26+
LL | | )
27+
LL | | };
28+
| |__^ type validation failed: encountered uninitialized bytes at [1]
29+
|
30+
= 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.
31+
= note: the raw bytes of the constant (size: 12, align: 4) {
32+
00 00 00 00 01 __ 01 01 02 02 __ 02 │ .....░....░.
33+
}
34+
35+
error[E0080]: it is undefined behavior to use this value
36+
--> $DIR/ub-int-array.rs:43:1
37+
|
38+
LL | / const UNINIT_INT_2: [u32; 3] = unsafe {
39+
LL | |
40+
LL | |
41+
LL | | mem::transmute(
42+
... |
43+
LL | | )
44+
LL | | };
45+
| |__^ type validation failed: encountered uninitialized bytes at [2]
46+
|
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+
= note: the raw bytes of the constant (size: 12, align: 4) {
49+
00 00 00 00 01 01 01 01 02 02 02 __ │ ...........░
50+
}
51+
52+
error: aborting due to 3 previous errors
53+
54+
For more information about this error, try `rustc --explain E0080`.

0 commit comments

Comments
 (0)