@@ -13,93 +13,105 @@ LL | fn f2(a: struct { field: u8 } ) {}
1313error: anonymous structs are not allowed outside of unnamed struct or union fields
1414 --> $DIR/restrict_anonymous_structs.rs:12:12
1515 |
16- LL | field: struct { field: u8 }
16+ LL | field: struct { field: u8 },
1717 | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
1818
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+
1925error: 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
2127 |
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
2436
2537error: 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
2739 |
28- LL | struct I (struct { field: u8 }, u8);
40+ LL | struct J (struct { field: u8 }, u8);
2941 | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
3042
3143error: 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
3345 |
34- LL | K (struct { field: u8 }),
46+ LL | L (struct { field: u8 }),
3547 | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
3648
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
3951 |
40- LL | _ : struct { field: u8 }
52+ LL | _ : struct { field: u8 },
4153 | -^^^^^^^^^^^^^^^^^^^^^^^
4254 | |
43- | anonymous field declared here
55+ | unnamed field declared here
4456
4557error: 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
4759 |
48- LL | _ : struct { field: u8 }
60+ LL | _ : struct { field: u8 },
4961 | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
5062
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
5365 |
54- LL | _ : u8
66+ LL | _ : u8,
5567 | -^^^^^
5668 | |
57- | anonymous field declared here
69+ | unnamed field declared here
5870
5971error: 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
6173 |
6274LL | const L: struct { field: u8 } = 0;
6375 | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
6476
6577error: 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
6779 |
6880LL | static M: struct { field: u8 } = 0;
6981 | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
7082
7183error: 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
7385 |
7486LL | type N = struct { field: u8 };
7587 | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
7688
7789error: 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
7991 |
8092LL | impl struct { field: u8 } {}
8193 | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
8294
8395error: 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
8597 |
8698LL | impl Foo for struct { field: u8 } {}
8799 | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
88100
89101error: 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
91103 |
92104LL | let p: [struct { field: u8 }; 1];
93105 | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
94106
95107error: 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
97109 |
98110LL | let q: (struct { field: u8 }, u8);
99111 | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
100112
101113error: 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
103115 |
104116LL | let c = || -> struct { field: u8 } {};
105117 | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
@@ -119,80 +131,92 @@ LL | fn f2(a: struct { field: u8 } ) {}
119131error: anonymous structs are unimplemented
120132 --> $DIR/restrict_anonymous_structs.rs:12:12
121133 |
122- LL | field: struct { field: u8 }
134+ LL | field: struct { field: u8 },
123135 | ^^^^^^^^^^^^^^^^^^^^
124136
125137error: anonymous structs are unimplemented
126- --> $DIR/restrict_anonymous_structs.rs:17:13
138+ --> $DIR/restrict_anonymous_structs.rs:14:8
127139 |
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+ | ^^^^^^^^^^^^^^^^^^^^
130154
131155error: anonymous structs are unimplemented
132- --> $DIR/restrict_anonymous_structs.rs:21 :10
156+ --> $DIR/restrict_anonymous_structs.rs:33 :10
133157 |
134- LL | struct I (struct { field: u8 }, u8);
158+ LL | struct J (struct { field: u8 }, u8);
135159 | ^^^^^^^^^^^^^^^^^^^^
136160
137161error: anonymous structs are unimplemented
138- --> $DIR/restrict_anonymous_structs.rs:25 :7
162+ --> $DIR/restrict_anonymous_structs.rs:37 :7
139163 |
140- LL | K (struct { field: u8 }),
164+ LL | L (struct { field: u8 }),
141165 | ^^^^^^^^^^^^^^^^^^^^
142166
143167error: anonymous structs are unimplemented
144- --> $DIR/restrict_anonymous_structs.rs:28 :13
168+ --> $DIR/restrict_anonymous_structs.rs:40 :13
145169 |
146- LL | _ : struct { field: u8 }
170+ LL | _ : struct { field: u8 },
147171 | ^^^^^^^^^^^^^^^^^^^^
148172
149173error: anonymous structs are unimplemented
150- --> $DIR/restrict_anonymous_structs.rs:37 :10
174+ --> $DIR/restrict_anonymous_structs.rs:49 :10
151175 |
152176LL | const L: struct { field: u8 } = 0;
153177 | ^^^^^^^^^^^^^^^^^^^^
154178
155179error: anonymous structs are unimplemented
156- --> $DIR/restrict_anonymous_structs.rs:40 :11
180+ --> $DIR/restrict_anonymous_structs.rs:52 :11
157181 |
158182LL | static M: struct { field: u8 } = 0;
159183 | ^^^^^^^^^^^^^^^^^^^^
160184
161185error: anonymous structs are unimplemented
162- --> $DIR/restrict_anonymous_structs.rs:43 :10
186+ --> $DIR/restrict_anonymous_structs.rs:55 :10
163187 |
164188LL | type N = struct { field: u8 };
165189 | ^^^^^^^^^^^^^^^^^^^^
166190
167191error: anonymous structs are unimplemented
168- --> $DIR/restrict_anonymous_structs.rs:46 :6
192+ --> $DIR/restrict_anonymous_structs.rs:58 :6
169193 |
170194LL | impl struct { field: u8 } {}
171195 | ^^^^^^^^^^^^^^^^^^^^
172196
173197error: anonymous structs are unimplemented
174- --> $DIR/restrict_anonymous_structs.rs:51 :14
198+ --> $DIR/restrict_anonymous_structs.rs:63 :14
175199 |
176200LL | impl Foo for struct { field: u8 } {}
177201 | ^^^^^^^^^^^^^^^^^^^^
178202
179203error: anonymous structs are unimplemented
180- --> $DIR/restrict_anonymous_structs.rs:55 :13
204+ --> $DIR/restrict_anonymous_structs.rs:67 :13
181205 |
182206LL | let p: [struct { field: u8 }; 1];
183207 | ^^^^^^^^^^^^^^^^^^^^
184208
185209error: anonymous structs are unimplemented
186- --> $DIR/restrict_anonymous_structs.rs:58 :13
210+ --> $DIR/restrict_anonymous_structs.rs:70 :13
187211 |
188212LL | let q: (struct { field: u8 }, u8);
189213 | ^^^^^^^^^^^^^^^^^^^^
190214
191215error: anonymous structs are unimplemented
192- --> $DIR/restrict_anonymous_structs.rs:61 :19
216+ --> $DIR/restrict_anonymous_structs.rs:73 :19
193217 |
194218LL | let c = || -> struct { field: u8 } {};
195219 | ^^^^^^^^^^^^^^^^^^^^
196220
197- error: aborting due to 32 previous errors
221+ error: aborting due to 36 previous errors
198222
0 commit comments