@@ -2,61 +2,57 @@ error[E0690]: transparent struct needs exactly one non-zero-sized field, but has
22 --> $DIR/repr-transparent.rs:11:1
33 |
44LL | struct NoFields;
5- | ^^^^^^^^^^^^^^^^
5+ | ^^^^^^^^^^^^^^^^ needs exactly one non-zero-sized field, but has 0
66
77error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 0
88 --> $DIR/repr-transparent.rs:14:1
99 |
1010LL | struct ContainsOnlyZst(());
11- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
11+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ needs exactly one non-zero-sized field, but has 0
1212
1313error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 0
1414 --> $DIR/repr-transparent.rs:17:1
1515 |
1616LL | struct ContainsOnlyZstArray([bool; 0]);
17- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ needs exactly one non-zero-sized field, but has 0
1818
1919error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 0
2020 --> $DIR/repr-transparent.rs:20:1
2121 |
2222LL | struct ContainsMultipleZst(PhantomData<*const i32>, NoFields);
23- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ needs exactly one non-zero-sized field, but has 0
2424
2525error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 2
2626 --> $DIR/repr-transparent.rs:24:1
2727 |
2828LL | struct MultipleNonZst(u8, u8);
29- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30- |
31- note: the following non-zero-sized fields exist on `MultipleNonZst`:
32- --> $DIR/repr-transparent.rs:24:23
33- |
34- LL | struct MultipleNonZst(u8, u8);
35- | ^^ ^^
29+ | ^^^^^^^^^^^^^^^^^^^^^^--^^--^^
30+ | | | |
31+ | | | this field is non-zero-sized
32+ | | this field is non-zero-sized
33+ | needs exactly one non-zero-sized field, but has 2
3634
3735error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 2
3836 --> $DIR/repr-transparent.rs:30:1
3937 |
4038LL | pub struct StructWithProjection(f32, <f32 as Mirror>::It);
41- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42- |
43- note: the following non-zero-sized fields exist on `StructWithProjection`:
44- --> $DIR/repr-transparent.rs:30:33
45- |
46- LL | pub struct StructWithProjection(f32, <f32 as Mirror>::It);
47- | ^^^ ^^^^^^^^^^^^^^^^^^^
39+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^-------------------^^
40+ | | | |
41+ | | | this field is non-zero-sized
42+ | | this field is non-zero-sized
43+ | needs exactly one non-zero-sized field, but has 2
4844
4945error[E0691]: zero-sized field in transparent struct has alignment larger than 1
5046 --> $DIR/repr-transparent.rs:34:32
5147 |
5248LL | struct NontrivialAlignZst(u32, [u16; 0]);
53- | ^^^^^^^^
49+ | ^^^^^^^^ has alignment larger than 1
5450
5551error[E0691]: zero-sized field in transparent struct has alignment larger than 1
5652 --> $DIR/repr-transparent.rs:40:24
5753 |
5854LL | struct GenericAlign<T>(ZstAlign32<T>, u32);
59- | ^^^^^^^^^^^^^
55+ | ^^^^^^^^^^^^^ has alignment larger than 1
6056
6157error[E0084]: unsupported representation for zero-variant enum
6258 --> $DIR/repr-transparent.rs:42:1
@@ -70,71 +66,49 @@ error[E0731]: transparent enum needs exactly one variant, but has 0
7066 --> $DIR/repr-transparent.rs:43:1
7167 |
7268LL | enum Void {}
73- | ^^^^^^^^^^^^
69+ | ^^^^^^^^^ needs exactly one variant, but has 0
7470
7571error[E0690]: the variant of a transparent enum needs exactly one non-zero-sized field, but has 0
7672 --> $DIR/repr-transparent.rs:47:1
7773 |
78- LL | / enum FieldlessEnum {
79- LL | | Foo,
80- LL | | }
81- | |_^
74+ LL | enum FieldlessEnum {
75+ | ^^^^^^^^^^^^^^^^^^ needs exactly one non-zero-sized field, but has 0
8276
8377error[E0690]: the variant of a transparent enum needs exactly one non-zero-sized field, but has 2
8478 --> $DIR/repr-transparent.rs:52:1
8579 |
86- LL | / enum TooManyFieldsEnum {
87- LL | | Foo(u32, String),
88- LL | | }
89- | |_^
90- |
91- note: the following non-zero-sized fields exist on `TooManyFieldsEnum`:
92- --> $DIR/repr-transparent.rs:53:9
93- |
80+ LL | enum TooManyFieldsEnum {
81+ | ^^^^^^^^^^^^^^^^^^^^^^ needs exactly one non-zero-sized field, but has 2
9482LL | Foo(u32, String),
95- | ^^^ ^^^^^^
83+ | --- ------ this field is non-zero-sized
84+ | |
85+ | this field is non-zero-sized
9686
9787error[E0731]: transparent enum needs exactly one variant, but has 2
9888 --> $DIR/repr-transparent.rs:58:1
9989 |
100- LL | / enum TooManyVariants {
101- LL | | Foo(String),
102- LL | | Bar,
103- LL | | }
104- | |_^
105- |
106- note: the following variants exist on `TooManyVariants`
107- --> $DIR/repr-transparent.rs:59:5
108- |
90+ LL | enum TooManyVariants {
91+ | ^^^^^^^^^^^^^^^^^^^^ needs exactly one variant, but has 2
10992LL | Foo(String),
110- | ^^^^^^^^^^^
93+ | -----------
11194LL | Bar,
112- | ^^^
95+ | --- too many variants in `TooManyVariants`
11396
11497error[E0690]: transparent union needs exactly one non-zero-sized field, but has 0
11598 --> $DIR/repr-transparent.rs:64:1
11699 |
117- LL | / union UnitUnion {
118- LL | | u: (),
119- LL | | }
120- | |_^
100+ LL | union UnitUnion {
101+ | ^^^^^^^^^^^^^^^ needs exactly one non-zero-sized field, but has 0
121102
122103error[E0690]: transparent union needs exactly one non-zero-sized field, but has 2
123104 --> $DIR/repr-transparent.rs:69:1
124105 |
125- LL | / union TooManyFields {
126- LL | | u: u32,
127- LL | | s: i32
128- LL | | }
129- | |_^
130- |
131- note: the following non-zero-sized fields exist on `TooManyFields`:
132- --> $DIR/repr-transparent.rs:70:5
133- |
106+ LL | union TooManyFields {
107+ | ^^^^^^^^^^^^^^^^^^^ needs exactly one non-zero-sized field, but has 2
134108LL | u: u32,
135- | ^^^^^^
109+ | ------ this field is non-zero-sized
136110LL | s: i32
137- | ^^^^^^
111+ | ------ this field is non-zero-sized
138112
139113error: aborting due to 15 previous errors
140114
0 commit comments