@@ -26,71 +26,65 @@ error: `#[label = ...]` is not a valid attribute
26
26
LL | #[label = "..."]
27
27
| ^^^^^^^^^^^^^^^^
28
28
29
- error: `#[label(bug = ...)]` is not a valid attribute
29
+ error: invalid nested attribute
30
30
--> $DIR/subdiagnostic-derive.rs:84:9
31
31
|
32
32
LL | #[label(bug = "...")]
33
- | ^^^^^^^^^^^
33
+ | ^^^
34
34
35
35
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
36
36
--> $DIR/subdiagnostic-derive.rs:84:1
37
37
|
38
38
LL | #[label(bug = "...")]
39
39
| ^^^^^^^^^^^^^^^^^^^^^
40
40
41
- error: `#[label("...")]` is not a valid attribute
41
+ error: unexpected literal in nested attribute, expected ident
42
42
--> $DIR/subdiagnostic-derive.rs:94:9
43
43
|
44
44
LL | #[label("...")]
45
45
| ^^^^^
46
46
47
- error: diagnostic slug must be first argument of a `#[label(...)]` attribute
48
- --> $DIR/subdiagnostic-derive.rs:94:1
49
- |
50
- LL | #[label("...")]
51
- | ^^^^^^^^^^^^^^^
52
-
53
- error: `#[label(slug = ...)]` is not a valid attribute
47
+ error: invalid nested attribute
54
48
--> $DIR/subdiagnostic-derive.rs:104:9
55
49
|
56
50
LL | #[label(slug = 4)]
57
- | ^^^^^^^^
51
+ | ^^^^
58
52
59
53
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
60
54
--> $DIR/subdiagnostic-derive.rs:104:1
61
55
|
62
56
LL | #[label(slug = 4)]
63
57
| ^^^^^^^^^^^^^^^^^^
64
58
65
- error: `#[label(slug(...))]` is not a valid attribute
59
+ error: invalid nested attribute
66
60
--> $DIR/subdiagnostic-derive.rs:114:9
67
61
|
68
62
LL | #[label(slug("..."))]
69
- | ^^^^^^^^^^^
63
+ | ^^^^
70
64
71
65
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
72
66
--> $DIR/subdiagnostic-derive.rs:114:1
73
67
|
74
68
LL | #[label(slug("..."))]
75
69
| ^^^^^^^^^^^^^^^^^^^^^
76
70
77
- error: diagnostic slug must be first argument of a `#[label(...)]` attribute
78
- --> $DIR/subdiagnostic-derive.rs:134:1
71
+ error: unexpected end of input, unexpected token in nested attribute, expected ident
72
+ --> $DIR/subdiagnostic-derive.rs:134:9
79
73
|
80
74
LL | #[label()]
81
- | ^^^^^^^^^ ^
75
+ | ^
82
76
83
- error: `#[label(code = ...)]` is not a valid attribute
77
+ error: invalid nested attribute
84
78
--> $DIR/subdiagnostic-derive.rs:143:27
85
79
|
86
80
LL | #[label(no_crate_example, code = "...")]
87
- | ^^^^^^^^^^^^
81
+ | ^^^^
88
82
89
- error: `#[label(applicability = ...)]` is not a valid attribute
83
+ error: invalid nested attribute
90
84
--> $DIR/subdiagnostic-derive.rs:152:27
91
85
|
92
86
LL | #[label(no_crate_example, applicability = "machine-applicable")]
93
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87
+ | ^^^^^^^^^^^^^
94
88
95
89
error: unsupported type attribute for subdiagnostic enum
96
90
--> $DIR/subdiagnostic-derive.rs:161:1
@@ -122,11 +116,11 @@ error: `#[bar(...)]` is not a valid attribute
122
116
LL | #[bar("...")]
123
117
| ^^^^^^^^^^^^^
124
118
125
- error: `#[label(code = ...)]` is not a valid attribute
119
+ error: invalid nested attribute
126
120
--> $DIR/subdiagnostic-derive.rs:223:13
127
121
|
128
122
LL | #[label(code = "...")]
129
- | ^^^^^^^^^^^^
123
+ | ^^^^
130
124
131
125
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
132
126
--> $DIR/subdiagnostic-derive.rs:223:5
@@ -190,13 +184,11 @@ LL | | b: u64,
190
184
LL | | }
191
185
| |_^
192
186
193
- error: `#[label(no_crate::example)]` is not a valid attribute
194
- --> $DIR/subdiagnostic-derive.rs:325:27
187
+ error: a diagnostic slug must be the first argument to the attribute
188
+ --> $DIR/subdiagnostic-derive.rs:325:44
195
189
|
196
190
LL | #[label(no_crate_example, no_crate::example)]
197
- | ^^^^^^^^^^^^^^^^^
198
- |
199
- = help: a diagnostic slug must be the first argument to the attribute
191
+ | ^
200
192
201
193
error: specified multiple times
202
194
--> $DIR/subdiagnostic-derive.rs:338:5
@@ -217,16 +209,16 @@ LL | struct AG {
217
209
| ^^
218
210
219
211
error: specified multiple times
220
- --> $DIR/subdiagnostic-derive.rs:381:46
212
+ --> $DIR/subdiagnostic-derive.rs:381:1
221
213
|
222
214
LL | #[suggestion(no_crate_example, code = "...", code = "...")]
223
- | ^^^^^^^^^^^^
215
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
224
216
|
225
217
note: previously specified here
226
- --> $DIR/subdiagnostic-derive.rs:381:32
218
+ --> $DIR/subdiagnostic-derive.rs:381:1
227
219
|
228
220
LL | #[suggestion(no_crate_example, code = "...", code = "...")]
229
- | ^^^^^^^^^^^^
221
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
230
222
231
223
error: specified multiple times
232
224
--> $DIR/subdiagnostic-derive.rs:399:5
@@ -253,10 +245,10 @@ LL | #[suggestion(no_crate_example)]
253
245
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
254
246
255
247
error: invalid applicability
256
- --> $DIR/subdiagnostic-derive.rs:432:46
248
+ --> $DIR/subdiagnostic-derive.rs:432:62
257
249
|
258
250
LL | #[suggestion(no_crate_example, code = "...", applicability = "foo")]
259
- | ^^^^^^^^^^^^^^^^ ^^^^^
251
+ | ^^^^^
260
252
261
253
error: suggestion without `#[primary_span]` field
262
254
--> $DIR/subdiagnostic-derive.rs:450:1
@@ -314,11 +306,11 @@ LL | | var: String,
314
306
LL | | }
315
307
| |_^
316
308
317
- error: `#[multipart_suggestion(code = ...)]` is not a valid attribute
309
+ error: invalid nested attribute
318
310
--> $DIR/subdiagnostic-derive.rs:538:42
319
311
|
320
312
LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
321
- | ^^^^^^^^^^^^
313
+ | ^^^^
322
314
|
323
315
= help: only `style` and `applicability` are valid nested attributes
324
316
@@ -339,11 +331,11 @@ error: `#[suggestion_part(...)]` attribute without `code = "..."`
339
331
LL | #[suggestion_part]
340
332
| ^^^^^^^^^^^^^^^^^^
341
333
342
- error: `#[suggestion_part(...)]` attribute without `code = "..."`
343
- --> $DIR/subdiagnostic-derive.rs:556:5
334
+ error: unexpected end of input, unexpected token in nested attribute, expected ident
335
+ --> $DIR/subdiagnostic-derive.rs:556:23
344
336
|
345
337
LL | #[suggestion_part()]
346
- | ^^^^^^^^^^^^^^^^^^^ ^
338
+ | ^
347
339
348
340
error: `#[primary_span]` is not a valid attribute
349
341
--> $DIR/subdiagnostic-derive.rs:565:5
@@ -371,19 +363,11 @@ error: `#[suggestion_part(...)]` attribute without `code = "..."`
371
363
LL | #[suggestion_part]
372
364
| ^^^^^^^^^^^^^^^^^^
373
365
374
- error: `#[suggestion_part(...)]` attribute without `code = "..."`
375
- --> $DIR/subdiagnostic-derive.rs:576:5
376
- |
377
- LL | #[suggestion_part()]
378
- | ^^^^^^^^^^^^^^^^^^^^
379
-
380
- error: `#[suggestion_part(foo = ...)]` is not a valid attribute
366
+ error: `code` is the only valid nested attribute
381
367
--> $DIR/subdiagnostic-derive.rs:579:23
382
368
|
383
369
LL | #[suggestion_part(foo = "bar")]
384
- | ^^^^^^^^^^^
385
- |
386
- = help: `code` is the only valid nested attribute
370
+ | ^^^
387
371
388
372
error: the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
389
373
--> $DIR/subdiagnostic-derive.rs:582:5
@@ -397,17 +381,29 @@ error: the `#[suggestion_part(...)]` attribute can only be applied to fields of
397
381
LL | #[suggestion_part()]
398
382
| ^^^^^^^^^^^^^^^^^^^^
399
383
384
+ error: unexpected end of input, unexpected token in nested attribute, expected ident
385
+ --> $DIR/subdiagnostic-derive.rs:576:23
386
+ |
387
+ LL | #[suggestion_part()]
388
+ | ^
389
+
390
+ error: expected `,`
391
+ --> $DIR/subdiagnostic-derive.rs:579:27
392
+ |
393
+ LL | #[suggestion_part(foo = "bar")]
394
+ | ^
395
+
400
396
error: specified multiple times
401
- --> $DIR/subdiagnostic-derive.rs:593:37
397
+ --> $DIR/subdiagnostic-derive.rs:593:5
402
398
|
403
399
LL | #[suggestion_part(code = "...", code = ",,,")]
404
- | ^^^^^^^^^^^^
400
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
405
401
|
406
402
note: previously specified here
407
- --> $DIR/subdiagnostic-derive.rs:593:23
403
+ --> $DIR/subdiagnostic-derive.rs:593:5
408
404
|
409
405
LL | #[suggestion_part(code = "...", code = ",,,")]
410
- | ^^^^^^^^^^^^
406
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
411
407
412
408
error: `#[applicability]` has no effect if all `#[suggestion]`/`#[multipart_suggestion]` attributes have a static `applicability = "..."`
413
409
--> $DIR/subdiagnostic-derive.rs:622:5
@@ -416,46 +412,64 @@ LL | #[applicability]
416
412
| ^^^^^^^^^^^^^^^^
417
413
418
414
error: expected exactly one string literal for `code = ...`
419
- --> $DIR/subdiagnostic-derive.rs:670:23
415
+ --> $DIR/subdiagnostic-derive.rs:670:34
420
416
|
421
417
LL | #[suggestion_part(code("foo"))]
422
- | ^^^^^^^^^^^
418
+ | ^
419
+
420
+ error: unexpected token
421
+ --> $DIR/subdiagnostic-derive.rs:670:28
422
+ |
423
+ LL | #[suggestion_part(code("foo"))]
424
+ | ^^^^^
423
425
424
426
error: expected exactly one string literal for `code = ...`
425
- --> $DIR/subdiagnostic-derive.rs:679:23
427
+ --> $DIR/subdiagnostic-derive.rs:679:41
428
+ |
429
+ LL | #[suggestion_part(code("foo", "bar"))]
430
+ | ^
431
+
432
+ error: unexpected token
433
+ --> $DIR/subdiagnostic-derive.rs:679:28
426
434
|
427
435
LL | #[suggestion_part(code("foo", "bar"))]
428
- | ^^^^^^^^^^^^^ ^^^^^
436
+ | ^^^^^
429
437
430
438
error: expected exactly one string literal for `code = ...`
431
- --> $DIR/subdiagnostic-derive.rs:688:23
439
+ --> $DIR/subdiagnostic-derive.rs:688:30
432
440
|
433
441
LL | #[suggestion_part(code(3))]
434
- | ^^^^^^^
442
+ | ^
443
+
444
+ error: unexpected token
445
+ --> $DIR/subdiagnostic-derive.rs:688:28
446
+ |
447
+ LL | #[suggestion_part(code(3))]
448
+ | ^
435
449
436
450
error: expected exactly one string literal for `code = ...`
437
- --> $DIR/subdiagnostic-derive.rs:697:23
451
+ --> $DIR/subdiagnostic-derive.rs:697:29
438
452
|
439
453
LL | #[suggestion_part(code())]
440
- | ^^^^^ ^
454
+ | ^
441
455
442
- error: `code = "..."`/`code(...)` must contain only string literals
443
- --> $DIR/subdiagnostic-derive.rs:706:23
456
+ error: expected string literal
457
+ --> $DIR/subdiagnostic-derive.rs:706:30
444
458
|
445
459
LL | #[suggestion_part(code = 3)]
446
- | ^^^^^^^ ^
460
+ | ^
447
461
448
462
error: specified multiple times
449
- --> $DIR/subdiagnostic-derive.rs:748:61
463
+ --> $DIR/subdiagnostic-derive.rs:748:1
450
464
|
451
465
LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
452
- | ^^^^^^^^^^^^^^^^
466
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
453
467
|
454
468
note: previously specified here
455
- --> $DIR/subdiagnostic-derive.rs:748:43
469
+ --> $DIR/subdiagnostic-derive.rs:748:1
456
470
|
457
471
LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
458
- | ^^^^^^^^^^^^^^^^
472
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
459
473
460
474
error: `#[suggestion_hidden(...)]` is not a valid attribute
461
475
--> $DIR/subdiagnostic-derive.rs:757:1
@@ -481,25 +495,29 @@ LL | #[suggestion(no_crate_example, code = "", style = "foo")]
481
495
|
482
496
= help: valid styles are `normal`, `short`, `hidden`, `verbose` and `tool-only`
483
497
484
- error: `#[suggestion(style = ...)]` is not a valid attribute
485
- --> $DIR/subdiagnostic-derive.rs:781:43
498
+ error: expected `= "xxx"`
499
+ --> $DIR/subdiagnostic-derive.rs:781:49
486
500
|
487
501
LL | #[suggestion(no_crate_example, code = "", style = 42)]
488
- | ^^^^^^^^^ ^
502
+ | ^
489
503
490
- error: `#[suggestion(style)]` is not a valid attribute
491
- --> $DIR/subdiagnostic-derive.rs:789:43
504
+ error: a diagnostic slug must be the first argument to the attribute
505
+ --> $DIR/subdiagnostic-derive.rs:789:48
492
506
|
493
507
LL | #[suggestion(no_crate_example, code = "", style)]
494
- | ^^^^^
508
+ | ^
509
+
510
+ error: expected `= "xxx"`
511
+ --> $DIR/subdiagnostic-derive.rs:797:48
495
512
|
496
- = help: a diagnostic slug must be the first argument to the attribute
513
+ LL | #[suggestion(no_crate_example, code = "", style("foo"))]
514
+ | ^
497
515
498
- error: `#[suggestion(style(...))]` is not a valid attribute
499
- --> $DIR/subdiagnostic-derive.rs:797:43
516
+ error: expected `,`
517
+ --> $DIR/subdiagnostic-derive.rs:797:48
500
518
|
501
519
LL | #[suggestion(no_crate_example, code = "", style("foo"))]
502
- | ^^^^^^^^^^^ ^
520
+ | ^
503
521
504
522
error: `#[primary_span]` is not a valid attribute
505
523
--> $DIR/subdiagnostic-derive.rs:808:5
@@ -582,6 +600,14 @@ error[E0425]: cannot find value `slug` in module `crate::fluent_generated`
582
600
LL | #[label(slug)]
583
601
| ^^^^ not found in `crate::fluent_generated`
584
602
585
- error: aborting due to 81 previous errors
603
+ error[E0425]: cannot find value `__code_29` in this scope
604
+ --> $DIR/subdiagnostic-derive.rs:703:10
605
+ |
606
+ LL | #[derive(Subdiagnostic)]
607
+ | ^^^^^^^^^^^^^ not found in this scope
608
+ |
609
+ = note: this error originates in the derive macro `Subdiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
610
+
611
+ error: aborting due to 86 previous errors
586
612
587
613
For more information about this error, try `rustc --explain E0425`.
0 commit comments