@@ -23,29 +23,50 @@ error[E0691]: zero-sized field in transparent struct has alignment larger than 1
2323 |
2424LL | struct NontrivialAlignZst(u32, [u16; 0]);
2525 | ^^^^^^^^ has alignment larger than 1
26+ |
27+ help: Try using `#[repc(C)]` instead
28+ |
29+ LL | #[repr(C)]
30+ | ~
2631
2732error[E0691]: zero-sized field in transparent struct has alignment larger than 1
2833 --> $DIR/repr-transparent.rs:42:24
2934 |
3035LL | struct GenericAlign<T>(ZstAlign32<T>, u32);
3136 | ^^^^^^^^^^^^^ has alignment larger than 1
37+ |
38+ help: Try using `#[repc(C)]` instead
39+ |
40+ LL | #[repr(C)]
41+ | ~
42+
43+ error[E0691]: zero-sized field in transparent struct has alignment larger than 1
44+ --> $DIR/repr-transparent.rs:45:33
45+ |
46+ LL | struct GenericAlignZeroArray<T>([T; 0], u32);
47+ | ^^^^^^ may have alignment larger than 1
48+ |
49+ help: Try using `#[repc(C)]` instead
50+ |
51+ LL | #[repr(C)]
52+ | ~
3253
3354error[E0084]: unsupported representation for zero-variant enum
34- --> $DIR/repr-transparent.rs:44 :1
55+ --> $DIR/repr-transparent.rs:47 :1
3556 |
3657LL | #[repr(transparent)]
3758 | ^^^^^^^^^^^^^^^^^^^^
3859LL | enum Void {}
3960 | ------------ zero-variant enum
4061
4162error[E0731]: transparent enum needs exactly one variant, but has 0
42- --> $DIR/repr-transparent.rs:45 :1
63+ --> $DIR/repr-transparent.rs:48 :1
4364 |
4465LL | enum Void {}
4566 | ^^^^^^^^^ needs exactly one variant, but has 0
4667
4768error[E0690]: the variant of a transparent enum needs at most one non-zero-sized field, but has 2
48- --> $DIR/repr-transparent.rs:58 :1
69+ --> $DIR/repr-transparent.rs:61 :1
4970 |
5071LL | enum TooManyFieldsEnum {
5172 | ^^^^^^^^^^^^^^^^^^^^^^ needs at most one non-zero-sized field, but has 2
@@ -55,7 +76,7 @@ LL | Foo(u32, String),
5576 | this field is non-zero-sized
5677
5778error[E0731]: transparent enum needs exactly one variant, but has 2
58- --> $DIR/repr-transparent.rs:64 :1
79+ --> $DIR/repr-transparent.rs:67 :1
5980 |
6081LL | enum MultipleVariants {
6182 | ^^^^^^^^^^^^^^^^^^^^^ needs exactly one variant, but has 2
@@ -65,19 +86,40 @@ LL | Bar,
6586 | --- too many variants in `MultipleVariants`
6687
6788error[E0691]: zero-sized field in transparent enum has alignment larger than 1
68- --> $DIR/repr-transparent.rs:71 :14
89+ --> $DIR/repr-transparent.rs:74 :14
6990 |
7091LL | Foo(u32, [u16; 0]),
7192 | ^^^^^^^^ has alignment larger than 1
93+ |
94+ help: Try using `#[repc(C)]` instead
95+ |
96+ LL | #[repr(C)]
97+ | ~
7298
7399error[E0691]: zero-sized field in transparent enum has alignment larger than 1
74- --> $DIR/repr-transparent.rs:76 :11
100+ --> $DIR/repr-transparent.rs:79 :11
75101 |
76102LL | Foo { bar: ZstAlign32<T>, baz: u32 }
77103 | ^^^^^^^^^^^^^^^^^^ has alignment larger than 1
104+ |
105+ help: Try using `#[repc(C)]` instead
106+ |
107+ LL | #[repr(C)]
108+ | ~
109+
110+ error[E0691]: zero-sized field in transparent enum has alignment larger than 1
111+ --> $DIR/repr-transparent.rs:84:11
112+ |
113+ LL | Foo { bar: [T; 0], baz: u32 }
114+ | ^^^^^^^^^^^ may have alignment larger than 1
115+ |
116+ help: Try using `#[repc(C)]` instead
117+ |
118+ LL | #[repr(C)]
119+ | ~
78120
79121error[E0690]: transparent union needs at most one non-zero-sized field, but has 2
80- --> $DIR/repr-transparent.rs:85 :1
122+ --> $DIR/repr-transparent.rs:93 :1
81123 |
82124LL | union TooManyFields {
83125 | ^^^^^^^^^^^^^^^^^^^ needs at most one non-zero-sized field, but has 2
@@ -86,7 +128,7 @@ LL | u: u32,
86128LL | s: i32
87129 | ------ this field is non-zero-sized
88130
89- error: aborting due to 11 previous errors
131+ error: aborting due to 13 previous errors
90132
91133Some errors have detailed explanations: E0084, E0690, E0691, E0731.
92134For more information about an error, try `rustc --explain E0084`.
0 commit comments