@@ -65,16 +65,16 @@ LL | #[label()]
65
65
| ^^^^^^^^^^
66
66
67
67
error: `code` is not a valid nested attribute of a `label` attribute
68
- --> $DIR/subdiagnostic-derive.rs:137:1
68
+ --> $DIR/subdiagnostic-derive.rs:137:28
69
69
|
70
70
LL | #[label(parser::add_paren, code = "...")]
71
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
71
+ | ^^^^^^^^^^^^
72
72
73
73
error: `applicability` is not a valid nested attribute of a `label` attribute
74
- --> $DIR/subdiagnostic-derive.rs:146:1
74
+ --> $DIR/subdiagnostic-derive.rs:146:28
75
75
|
76
76
LL | #[label(parser::add_paren, applicability = "machine-applicable")]
77
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
77
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78
78
79
79
error: unsupported type attribute for subdiagnostic enum
80
80
--> $DIR/subdiagnostic-derive.rs:155:1
@@ -100,13 +100,11 @@ error: `#[bar = ...]` is not a valid attribute
100
100
LL | #[bar = 4]
101
101
| ^^^^^^^^^^
102
102
103
- error: `#[bar(" ..." )]` is not a valid attribute
104
- --> $DIR/subdiagnostic-derive.rs:205:11
103
+ error: `#[bar(...)]` is not a valid attribute
104
+ --> $DIR/subdiagnostic-derive.rs:205:5
105
105
|
106
106
LL | #[bar("...")]
107
- | ^^^^^
108
- |
109
- = help: first argument of the attribute should be the diagnostic slug
107
+ | ^^^^^^^^^^^^^
110
108
111
109
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
112
110
--> $DIR/subdiagnostic-derive.rs:217:5
@@ -163,6 +161,8 @@ error: `#[bar(...)]` is not a valid attribute
163
161
|
164
162
LL | #[bar("...")]
165
163
| ^^^^^^^^^^^^^
164
+ |
165
+ = help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
166
166
167
167
error: unexpected unsupported untagged union
168
168
--> $DIR/subdiagnostic-derive.rs:304:1
@@ -175,19 +175,7 @@ LL | | }
175
175
| |_^
176
176
177
177
error: specified multiple times
178
- --> $DIR/subdiagnostic-derive.rs:314:1
179
- |
180
- LL | #[label(parser::add_paren)]
181
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
182
- |
183
- note: previously specified here
184
- --> $DIR/subdiagnostic-derive.rs:311:1
185
- |
186
- LL | #[label(parser::add_paren)]
187
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
188
-
189
- error: specified multiple times
190
- --> $DIR/subdiagnostic-derive.rs:314:1
178
+ --> $DIR/subdiagnostic-derive.rs:313:1
191
179
|
192
180
LL | #[label(parser::add_paren)]
193
181
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -199,81 +187,75 @@ LL | #[label(parser::add_paren)]
199
187
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
200
188
201
189
error: `#[label(parser::add_paren)]` is not a valid attribute
202
- --> $DIR/subdiagnostic-derive.rs:323 :28
190
+ --> $DIR/subdiagnostic-derive.rs:321 :28
203
191
|
204
192
LL | #[label(parser::add_paren, parser::add_paren)]
205
193
| ^^^^^^^^^^^^^^^^^
206
194
|
207
195
= help: a diagnostic slug must be the first argument to the attribute
208
196
209
197
error: specified multiple times
210
- --> $DIR/subdiagnostic-derive.rs:336 :5
198
+ --> $DIR/subdiagnostic-derive.rs:334 :5
211
199
|
212
200
LL | #[primary_span]
213
201
| ^^^^^^^^^^^^^^^
214
202
|
215
203
note: previously specified here
216
- --> $DIR/subdiagnostic-derive.rs:333 :5
204
+ --> $DIR/subdiagnostic-derive.rs:331 :5
217
205
|
218
206
LL | #[primary_span]
219
207
| ^^^^^^^^^^^^^^^
220
208
221
209
error: subdiagnostic kind not specified
222
- --> $DIR/subdiagnostic-derive.rs:342 :8
210
+ --> $DIR/subdiagnostic-derive.rs:340 :8
223
211
|
224
212
LL | struct AG {
225
213
| ^^
226
214
227
215
error: specified multiple times
228
- --> $DIR/subdiagnostic-derive.rs:379 :47
216
+ --> $DIR/subdiagnostic-derive.rs:377 :47
229
217
|
230
218
LL | #[suggestion(parser::add_paren, code = "...", code = "...")]
231
219
| ^^^^^^^^^^^^
232
220
|
233
221
note: previously specified here
234
- --> $DIR/subdiagnostic-derive.rs:379 :33
222
+ --> $DIR/subdiagnostic-derive.rs:377 :33
235
223
|
236
224
LL | #[suggestion(parser::add_paren, code = "...", code = "...")]
237
225
| ^^^^^^^^^^^^
238
226
239
227
error: specified multiple times
240
- --> $DIR/subdiagnostic-derive.rs:397 :5
228
+ --> $DIR/subdiagnostic-derive.rs:395 :5
241
229
|
242
230
LL | #[applicability]
243
231
| ^^^^^^^^^^^^^^^^
244
232
|
245
233
note: previously specified here
246
- --> $DIR/subdiagnostic-derive.rs:394 :5
234
+ --> $DIR/subdiagnostic-derive.rs:392 :5
247
235
|
248
236
LL | #[applicability]
249
237
| ^^^^^^^^^^^^^^^^
250
238
251
239
error: the `#[applicability]` attribute can only be applied to fields of type `Applicability`
252
- --> $DIR/subdiagnostic-derive.rs:407 :5
240
+ --> $DIR/subdiagnostic-derive.rs:405 :5
253
241
|
254
242
LL | #[applicability]
255
243
| ^^^^^^^^^^^^^^^^
256
244
257
245
error: suggestion without `code = "..."`
258
- --> $DIR/subdiagnostic-derive.rs:420 :1
246
+ --> $DIR/subdiagnostic-derive.rs:418 :1
259
247
|
260
- LL | / #[suggestion(parser::add_paren)]
261
- LL | |
262
- LL | | struct AN {
263
- LL | | #[primary_span]
264
- ... |
265
- LL | | applicability: Applicability,
266
- LL | | }
267
- | |_^
248
+ LL | #[suggestion(parser::add_paren)]
249
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
268
250
269
251
error: invalid applicability
270
- --> $DIR/subdiagnostic-derive.rs:430 :46
252
+ --> $DIR/subdiagnostic-derive.rs:428 :46
271
253
|
272
254
LL | #[suggestion(parser::add_paren, code ="...", applicability = "foo")]
273
255
| ^^^^^^^^^^^^^^^^^^^^^
274
256
275
257
error: suggestion without `#[primary_span]` field
276
- --> $DIR/subdiagnostic-derive.rs:448 :1
258
+ --> $DIR/subdiagnostic-derive.rs:446 :1
277
259
|
278
260
LL | / #[suggestion(parser::add_paren, code = "...")]
279
261
LL | |
@@ -283,23 +265,156 @@ LL | | }
283
265
| |_^
284
266
285
267
error: unsupported type attribute for subdiagnostic enum
286
- --> $DIR/subdiagnostic-derive.rs:462 :1
268
+ --> $DIR/subdiagnostic-derive.rs:460 :1
287
269
|
288
270
LL | #[label]
289
271
| ^^^^^^^^
290
272
291
273
error: `var` doesn't refer to a field on this type
292
- --> $DIR/subdiagnostic-derive.rs:482 :39
274
+ --> $DIR/subdiagnostic-derive.rs:480 :39
293
275
|
294
276
LL | #[suggestion(parser::add_paren, code ="{var}", applicability = "machine-applicable")]
295
277
| ^^^^^^^
296
278
297
279
error: `var` doesn't refer to a field on this type
298
- --> $DIR/subdiagnostic-derive.rs:501 :43
280
+ --> $DIR/subdiagnostic-derive.rs:499 :43
299
281
|
300
282
LL | #[suggestion(parser::add_paren, code ="{var}", applicability = "machine-applicable")]
301
283
| ^^^^^^^
302
284
285
+ error: `#[suggestion_part]` is not a valid attribute
286
+ --> $DIR/subdiagnostic-derive.rs:523:5
287
+ |
288
+ LL | #[suggestion_part]
289
+ | ^^^^^^^^^^^^^^^^^^
290
+ |
291
+ = help: `#[suggestion_part(...)]` is only valid in multipart suggestions, use `#[primary_span]` instead
292
+
293
+ error: `#[suggestion_part(...)]` is not a valid attribute
294
+ --> $DIR/subdiagnostic-derive.rs:526:5
295
+ |
296
+ LL | #[suggestion_part(code = "...")]
297
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
298
+ |
299
+ = help: `#[suggestion_part(...)]` is only valid in multipart suggestions
300
+
301
+ error: suggestion without `#[primary_span]` field
302
+ --> $DIR/subdiagnostic-derive.rs:520:1
303
+ |
304
+ LL | / #[suggestion(parser::add_paren, code = "...")]
305
+ LL | |
306
+ LL | | struct BA {
307
+ LL | | #[suggestion_part]
308
+ ... |
309
+ LL | | var: String,
310
+ LL | | }
311
+ | |_^
312
+
313
+ error: `code` is not a valid nested attribute of a `multipart_suggestion` attribute
314
+ --> $DIR/subdiagnostic-derive.rs:535:43
315
+ |
316
+ LL | #[multipart_suggestion(parser::add_paren, code = "...", applicability = "machine-applicable")]
317
+ | ^^^^^^^^^^^^
318
+
319
+ error: multipart suggestion without any `#[suggestion_part(...)]` fields
320
+ --> $DIR/subdiagnostic-derive.rs:535:1
321
+ |
322
+ LL | / #[multipart_suggestion(parser::add_paren, code = "...", applicability = "machine-applicable")]
323
+ LL | |
324
+ LL | |
325
+ LL | | struct BBa {
326
+ LL | | var: String,
327
+ LL | | }
328
+ | |_^
329
+
330
+ error: `#[suggestion_part(...)]` attribute without `code = "..."`
331
+ --> $DIR/subdiagnostic-derive.rs:545:5
332
+ |
333
+ LL | #[suggestion_part]
334
+ | ^^^^^^^^^^^^^^^^^^
335
+
336
+ error: `#[suggestion_part(...)]` attribute without `code = "..."`
337
+ --> $DIR/subdiagnostic-derive.rs:553:5
338
+ |
339
+ LL | #[suggestion_part()]
340
+ | ^^^^^^^^^^^^^^^^^^^^
341
+
342
+ error: `#[primary_span]` is not a valid attribute
343
+ --> $DIR/subdiagnostic-derive.rs:562:5
344
+ |
345
+ LL | #[primary_span]
346
+ | ^^^^^^^^^^^^^^^
347
+ |
348
+ = help: multipart suggestions use one or more `#[suggestion_part]`s rather than one `#[primary_span]`
349
+
350
+ error: multipart suggestion without any `#[suggestion_part(...)]` fields
351
+ --> $DIR/subdiagnostic-derive.rs:559:1
352
+ |
353
+ LL | / #[multipart_suggestion(parser::add_paren)]
354
+ LL | |
355
+ LL | | struct BC {
356
+ LL | | #[primary_span]
357
+ LL | |
358
+ LL | | span: Span,
359
+ LL | | }
360
+ | |_^
361
+
362
+ error: `#[suggestion_part(...)]` attribute without `code = "..."`
363
+ --> $DIR/subdiagnostic-derive.rs:570:5
364
+ |
365
+ LL | #[suggestion_part]
366
+ | ^^^^^^^^^^^^^^^^^^
367
+
368
+ error: `#[suggestion_part(...)]` attribute without `code = "..."`
369
+ --> $DIR/subdiagnostic-derive.rs:573:5
370
+ |
371
+ LL | #[suggestion_part()]
372
+ | ^^^^^^^^^^^^^^^^^^^^
373
+
374
+ error: `#[suggestion_part(foo = ...)]` is not a valid attribute
375
+ --> $DIR/subdiagnostic-derive.rs:576:23
376
+ |
377
+ LL | #[suggestion_part(foo = "bar")]
378
+ | ^^^^^^^^^^^
379
+ |
380
+ = help: `code` is the only valid nested attribute
381
+
382
+ error: the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
383
+ --> $DIR/subdiagnostic-derive.rs:579:5
384
+ |
385
+ LL | #[suggestion_part(code = "...")]
386
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
387
+
388
+ error: the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
389
+ --> $DIR/subdiagnostic-derive.rs:582:5
390
+ |
391
+ LL | #[suggestion_part()]
392
+ | ^^^^^^^^^^^^^^^^^^^^
393
+
394
+ error: specified multiple times
395
+ --> $DIR/subdiagnostic-derive.rs:590:37
396
+ |
397
+ LL | #[suggestion_part(code = "...", code = ",,,")]
398
+ | ^^^^^^^^^^^^
399
+ |
400
+ note: previously specified here
401
+ --> $DIR/subdiagnostic-derive.rs:590:23
402
+ |
403
+ LL | #[suggestion_part(code = "...", code = ",,,")]
404
+ | ^^^^^^^^^^^^
405
+
406
+ error: specified multiple times
407
+ --> $DIR/subdiagnostic-derive.rs:620:5
408
+ |
409
+ LL | #[applicability]
410
+ | ^^^^^^^^^^^^^^^^
411
+ |
412
+ note: previously specified here
413
+ --> $DIR/subdiagnostic-derive.rs:617:43
414
+ |
415
+ LL | #[multipart_suggestion(parser::add_paren, applicability = "machine-applicable")]
416
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
417
+
303
418
error: cannot find attribute `foo` in this scope
304
419
--> $DIR/subdiagnostic-derive.rs:63:3
305
420
|
@@ -360,6 +475,6 @@ error[E0425]: cannot find value `slug` in module `rustc_errors::fluent`
360
475
LL | #[label(slug)]
361
476
| ^^^^ not found in `rustc_errors::fluent`
362
477
363
- error: aborting due to 49 previous errors
478
+ error: aborting due to 64 previous errors
364
479
365
480
For more information about this error, try `rustc --explain E0425`.
0 commit comments