@@ -13,93 +13,105 @@ LL | fn f2(a: struct { field: u8 } ) {}
13
13
error: anonymous structs are not allowed outside of unnamed struct or union fields
14
14
--> $DIR/restrict_anonymous_structs.rs:12:12
15
15
|
16
- LL | field: struct { field: u8 }
16
+ LL | field: struct { field: u8 },
17
17
| ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
18
18
19
+ error: unnamed fields can only have struct or union types
20
+ --> $DIR/restrict_anonymous_structs.rs:19:5
21
+ |
22
+ LL | _: (u8, u8),
23
+ | ^ -------- not a struct or union
24
+
19
25
error: anonymous structs are not allowed outside of unnamed struct or union fields
20
- --> $DIR/restrict_anonymous_structs.rs:17:13
26
+ --> $DIR/restrict_anonymous_structs.rs:23:12
21
27
|
22
- LL | field1: struct { field: u8 }
23
- | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
28
+ LL | field: struct { field: u8 },
29
+ | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
30
+
31
+ error: unnamed fields can only have struct or union types
32
+ --> $DIR/restrict_anonymous_structs.rs:30:5
33
+ |
34
+ LL | _: (u8, u8),
35
+ | ^ -------- not a struct or union
24
36
25
37
error: anonymous structs are not allowed outside of unnamed struct or union fields
26
- --> $DIR/restrict_anonymous_structs.rs:21 :10
38
+ --> $DIR/restrict_anonymous_structs.rs:33 :10
27
39
|
28
- LL | struct I (struct { field: u8 }, u8);
40
+ LL | struct J (struct { field: u8 }, u8);
29
41
| ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
30
42
31
43
error: anonymous structs are not allowed outside of unnamed struct or union fields
32
- --> $DIR/restrict_anonymous_structs.rs:25 :7
44
+ --> $DIR/restrict_anonymous_structs.rs:37 :7
33
45
|
34
- LL | K (struct { field: u8 }),
46
+ LL | L (struct { field: u8 }),
35
47
| ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
36
48
37
- error: anonymous fields are not allowed outside of structs or unions
38
- --> $DIR/restrict_anonymous_structs.rs:28 :9
49
+ error: unnamed fields are not allowed outside of structs or unions
50
+ --> $DIR/restrict_anonymous_structs.rs:40 :9
39
51
|
40
- LL | _ : struct { field: u8 }
52
+ LL | _ : struct { field: u8 },
41
53
| -^^^^^^^^^^^^^^^^^^^^^^^
42
54
| |
43
- | anonymous field declared here
55
+ | unnamed field declared here
44
56
45
57
error: anonymous structs are not allowed outside of unnamed struct or union fields
46
- --> $DIR/restrict_anonymous_structs.rs:28 :13
58
+ --> $DIR/restrict_anonymous_structs.rs:40 :13
47
59
|
48
- LL | _ : struct { field: u8 }
60
+ LL | _ : struct { field: u8 },
49
61
| ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
50
62
51
- error: anonymous fields are not allowed outside of structs or unions
52
- --> $DIR/restrict_anonymous_structs.rs:33 :9
63
+ error: unnamed fields are not allowed outside of structs or unions
64
+ --> $DIR/restrict_anonymous_structs.rs:45 :9
53
65
|
54
- LL | _ : u8
66
+ LL | _ : u8,
55
67
| -^^^^^
56
68
| |
57
- | anonymous field declared here
69
+ | unnamed field declared here
58
70
59
71
error: anonymous structs are not allowed outside of unnamed struct or union fields
60
- --> $DIR/restrict_anonymous_structs.rs:37 :10
72
+ --> $DIR/restrict_anonymous_structs.rs:49 :10
61
73
|
62
74
LL | const L: struct { field: u8 } = 0;
63
75
| ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
64
76
65
77
error: anonymous structs are not allowed outside of unnamed struct or union fields
66
- --> $DIR/restrict_anonymous_structs.rs:40 :11
78
+ --> $DIR/restrict_anonymous_structs.rs:52 :11
67
79
|
68
80
LL | static M: struct { field: u8 } = 0;
69
81
| ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
70
82
71
83
error: anonymous structs are not allowed outside of unnamed struct or union fields
72
- --> $DIR/restrict_anonymous_structs.rs:43 :10
84
+ --> $DIR/restrict_anonymous_structs.rs:55 :10
73
85
|
74
86
LL | type N = struct { field: u8 };
75
87
| ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
76
88
77
89
error: anonymous structs are not allowed outside of unnamed struct or union fields
78
- --> $DIR/restrict_anonymous_structs.rs:46 :6
90
+ --> $DIR/restrict_anonymous_structs.rs:58 :6
79
91
|
80
92
LL | impl struct { field: u8 } {}
81
93
| ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
82
94
83
95
error: anonymous structs are not allowed outside of unnamed struct or union fields
84
- --> $DIR/restrict_anonymous_structs.rs:51 :14
96
+ --> $DIR/restrict_anonymous_structs.rs:63 :14
85
97
|
86
98
LL | impl Foo for struct { field: u8 } {}
87
99
| ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
88
100
89
101
error: anonymous structs are not allowed outside of unnamed struct or union fields
90
- --> $DIR/restrict_anonymous_structs.rs:55 :13
102
+ --> $DIR/restrict_anonymous_structs.rs:67 :13
91
103
|
92
104
LL | let p: [struct { field: u8 }; 1];
93
105
| ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
94
106
95
107
error: anonymous structs are not allowed outside of unnamed struct or union fields
96
- --> $DIR/restrict_anonymous_structs.rs:58 :13
108
+ --> $DIR/restrict_anonymous_structs.rs:70 :13
97
109
|
98
110
LL | let q: (struct { field: u8 }, u8);
99
111
| ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
100
112
101
113
error: anonymous structs are not allowed outside of unnamed struct or union fields
102
- --> $DIR/restrict_anonymous_structs.rs:61 :19
114
+ --> $DIR/restrict_anonymous_structs.rs:73 :19
103
115
|
104
116
LL | let c = || -> struct { field: u8 } {};
105
117
| ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
@@ -119,80 +131,92 @@ LL | fn f2(a: struct { field: u8 } ) {}
119
131
error: anonymous structs are unimplemented
120
132
--> $DIR/restrict_anonymous_structs.rs:12:12
121
133
|
122
- LL | field: struct { field: u8 }
134
+ LL | field: struct { field: u8 },
123
135
| ^^^^^^^^^^^^^^^^^^^^
124
136
125
137
error: anonymous structs are unimplemented
126
- --> $DIR/restrict_anonymous_structs.rs:17:13
138
+ --> $DIR/restrict_anonymous_structs.rs:14:8
127
139
|
128
- LL | field1: struct { field: u8 }
129
- | ^^^^^^^^^^^^^^^^^^^^
140
+ LL | _: struct { field: u8 },
141
+ | ^^^^^^^^^^^^^^^^^^^^
142
+
143
+ error: anonymous structs are unimplemented
144
+ --> $DIR/restrict_anonymous_structs.rs:23:12
145
+ |
146
+ LL | field: struct { field: u8 },
147
+ | ^^^^^^^^^^^^^^^^^^^^
148
+
149
+ error: anonymous structs are unimplemented
150
+ --> $DIR/restrict_anonymous_structs.rs:25:8
151
+ |
152
+ LL | _: struct { field: u8 },
153
+ | ^^^^^^^^^^^^^^^^^^^^
130
154
131
155
error: anonymous structs are unimplemented
132
- --> $DIR/restrict_anonymous_structs.rs:21 :10
156
+ --> $DIR/restrict_anonymous_structs.rs:33 :10
133
157
|
134
- LL | struct I (struct { field: u8 }, u8);
158
+ LL | struct J (struct { field: u8 }, u8);
135
159
| ^^^^^^^^^^^^^^^^^^^^
136
160
137
161
error: anonymous structs are unimplemented
138
- --> $DIR/restrict_anonymous_structs.rs:25 :7
162
+ --> $DIR/restrict_anonymous_structs.rs:37 :7
139
163
|
140
- LL | K (struct { field: u8 }),
164
+ LL | L (struct { field: u8 }),
141
165
| ^^^^^^^^^^^^^^^^^^^^
142
166
143
167
error: anonymous structs are unimplemented
144
- --> $DIR/restrict_anonymous_structs.rs:28 :13
168
+ --> $DIR/restrict_anonymous_structs.rs:40 :13
145
169
|
146
- LL | _ : struct { field: u8 }
170
+ LL | _ : struct { field: u8 },
147
171
| ^^^^^^^^^^^^^^^^^^^^
148
172
149
173
error: anonymous structs are unimplemented
150
- --> $DIR/restrict_anonymous_structs.rs:37 :10
174
+ --> $DIR/restrict_anonymous_structs.rs:49 :10
151
175
|
152
176
LL | const L: struct { field: u8 } = 0;
153
177
| ^^^^^^^^^^^^^^^^^^^^
154
178
155
179
error: anonymous structs are unimplemented
156
- --> $DIR/restrict_anonymous_structs.rs:40 :11
180
+ --> $DIR/restrict_anonymous_structs.rs:52 :11
157
181
|
158
182
LL | static M: struct { field: u8 } = 0;
159
183
| ^^^^^^^^^^^^^^^^^^^^
160
184
161
185
error: anonymous structs are unimplemented
162
- --> $DIR/restrict_anonymous_structs.rs:43 :10
186
+ --> $DIR/restrict_anonymous_structs.rs:55 :10
163
187
|
164
188
LL | type N = struct { field: u8 };
165
189
| ^^^^^^^^^^^^^^^^^^^^
166
190
167
191
error: anonymous structs are unimplemented
168
- --> $DIR/restrict_anonymous_structs.rs:46 :6
192
+ --> $DIR/restrict_anonymous_structs.rs:58 :6
169
193
|
170
194
LL | impl struct { field: u8 } {}
171
195
| ^^^^^^^^^^^^^^^^^^^^
172
196
173
197
error: anonymous structs are unimplemented
174
- --> $DIR/restrict_anonymous_structs.rs:51 :14
198
+ --> $DIR/restrict_anonymous_structs.rs:63 :14
175
199
|
176
200
LL | impl Foo for struct { field: u8 } {}
177
201
| ^^^^^^^^^^^^^^^^^^^^
178
202
179
203
error: anonymous structs are unimplemented
180
- --> $DIR/restrict_anonymous_structs.rs:55 :13
204
+ --> $DIR/restrict_anonymous_structs.rs:67 :13
181
205
|
182
206
LL | let p: [struct { field: u8 }; 1];
183
207
| ^^^^^^^^^^^^^^^^^^^^
184
208
185
209
error: anonymous structs are unimplemented
186
- --> $DIR/restrict_anonymous_structs.rs:58 :13
210
+ --> $DIR/restrict_anonymous_structs.rs:70 :13
187
211
|
188
212
LL | let q: (struct { field: u8 }, u8);
189
213
| ^^^^^^^^^^^^^^^^^^^^
190
214
191
215
error: anonymous structs are unimplemented
192
- --> $DIR/restrict_anonymous_structs.rs:61 :19
216
+ --> $DIR/restrict_anonymous_structs.rs:73 :19
193
217
|
194
218
LL | let c = || -> struct { field: u8 } {};
195
219
| ^^^^^^^^^^^^^^^^^^^^
196
220
197
- error: aborting due to 32 previous errors
221
+ error: aborting due to 36 previous errors
198
222
0 commit comments