@@ -23,29 +23,50 @@ error[E0691]: zero-sized field in transparent struct has alignment larger than 1
23
23
|
24
24
LL | struct NontrivialAlignZst(u32, [u16; 0]);
25
25
| ^^^^^^^^ has alignment larger than 1
26
+ |
27
+ help: Try using `#[repc(C)]` instead
28
+ |
29
+ LL | #[repr(C)]
30
+ | ~
26
31
27
32
error[E0691]: zero-sized field in transparent struct has alignment larger than 1
28
33
--> $DIR/repr-transparent.rs:42:24
29
34
|
30
35
LL | struct GenericAlign<T>(ZstAlign32<T>, u32);
31
36
| ^^^^^^^^^^^^^ 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
+ | ~
32
53
33
54
error[E0084]: unsupported representation for zero-variant enum
34
- --> $DIR/repr-transparent.rs:44 :1
55
+ --> $DIR/repr-transparent.rs:47 :1
35
56
|
36
57
LL | #[repr(transparent)]
37
58
| ^^^^^^^^^^^^^^^^^^^^
38
59
LL | enum Void {}
39
60
| ------------ zero-variant enum
40
61
41
62
error[E0731]: transparent enum needs exactly one variant, but has 0
42
- --> $DIR/repr-transparent.rs:45 :1
63
+ --> $DIR/repr-transparent.rs:48 :1
43
64
|
44
65
LL | enum Void {}
45
66
| ^^^^^^^^^ needs exactly one variant, but has 0
46
67
47
68
error[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
49
70
|
50
71
LL | enum TooManyFieldsEnum {
51
72
| ^^^^^^^^^^^^^^^^^^^^^^ needs at most one non-zero-sized field, but has 2
@@ -55,7 +76,7 @@ LL | Foo(u32, String),
55
76
| this field is non-zero-sized
56
77
57
78
error[E0731]: transparent enum needs exactly one variant, but has 2
58
- --> $DIR/repr-transparent.rs:64 :1
79
+ --> $DIR/repr-transparent.rs:67 :1
59
80
|
60
81
LL | enum MultipleVariants {
61
82
| ^^^^^^^^^^^^^^^^^^^^^ needs exactly one variant, but has 2
@@ -65,19 +86,40 @@ LL | Bar,
65
86
| --- too many variants in `MultipleVariants`
66
87
67
88
error[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
69
90
|
70
91
LL | Foo(u32, [u16; 0]),
71
92
| ^^^^^^^^ has alignment larger than 1
93
+ |
94
+ help: Try using `#[repc(C)]` instead
95
+ |
96
+ LL | #[repr(C)]
97
+ | ~
72
98
73
99
error[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
75
101
|
76
102
LL | Foo { bar: ZstAlign32<T>, baz: u32 }
77
103
| ^^^^^^^^^^^^^^^^^^ 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
+ | ~
78
120
79
121
error[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
81
123
|
82
124
LL | union TooManyFields {
83
125
| ^^^^^^^^^^^^^^^^^^^ needs at most one non-zero-sized field, but has 2
@@ -86,7 +128,7 @@ LL | u: u32,
86
128
LL | s: i32
87
129
| ------ this field is non-zero-sized
88
130
89
- error: aborting due to 11 previous errors
131
+ error: aborting due to 13 previous errors
90
132
91
133
Some errors have detailed explanations: E0084, E0690, E0691, E0731.
92
134
For more information about an error, try `rustc --explain E0084`.
0 commit comments