1 error: unsupported type attribute for diagnostic derive enum
2 --> $DIR/diagnostic-derive.rs:39:1
4 LL | #[diag(compiletest_example, code = "E0123")]
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 error: diagnostic slug not specified
8 --> $DIR/diagnostic-derive.rs:42:5
13 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
15 error: diagnostic slug not specified
16 --> $DIR/diagnostic-derive.rs:44:5
21 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
23 error: `#[diag = ...]` is not a valid attribute
24 --> $DIR/diagnostic-derive.rs:50:1
26 LL | #[diag = "E0123"]
29 error: `#[nonsense(...)]` is not a valid attribute
30 --> $DIR/diagnostic-derive.rs:55:1
32 LL | #[nonsense(compiletest_example, code = "E0123")]
33 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35 error: diagnostic slug not specified
36 --> $DIR/diagnostic-derive.rs:55:1
38 LL | / #[nonsense(compiletest_example, code = "E0123")]
42 LL | | struct InvalidStructAttr {}
43 | |___________________________^
45 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
47 error: `#[diag("...")]` is not a valid attribute
48 --> $DIR/diagnostic-derive.rs:62:8
53 = help: a diagnostic slug is required as the first argument
55 error: diagnostic slug not specified
56 --> $DIR/diagnostic-derive.rs:62:1
58 LL | / #[diag("E0123")]
61 LL | | struct InvalidLitNestedAttr {}
62 | |______________________________^
64 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
66 error: `#[diag(nonsense(...))]` is not a valid attribute
67 --> $DIR/diagnostic-derive.rs:73:8
69 LL | #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
72 = help: a diagnostic slug is required as the first argument
74 error: diagnostic slug not specified
75 --> $DIR/diagnostic-derive.rs:73:1
77 LL | / #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
80 LL | | struct InvalidNestedStructAttr1 {}
81 | |__________________________________^
83 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
85 error: `#[diag(nonsense = ...)]` is not a valid attribute
86 --> $DIR/diagnostic-derive.rs:79:8
88 LL | #[diag(nonsense = "...", code = "E0123", slug = "foo")]
91 = help: only `code` is a valid nested attributes following the slug
93 error: `#[diag(slug = ...)]` is not a valid attribute
94 --> $DIR/diagnostic-derive.rs:79:42
96 LL | #[diag(nonsense = "...", code = "E0123", slug = "foo")]
99 = help: only `code` is a valid nested attributes following the slug
101 error: diagnostic slug not specified
102 --> $DIR/diagnostic-derive.rs:79:1
104 LL | / #[diag(nonsense = "...", code = "E0123", slug = "foo")]
108 LL | | struct InvalidNestedStructAttr2 {}
109 | |__________________________________^
111 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
113 error: `#[diag(nonsense = ...)]` is not a valid attribute
114 --> $DIR/diagnostic-derive.rs:86:8
116 LL | #[diag(nonsense = 4, code = "E0123", slug = "foo")]
119 error: `#[diag(slug = ...)]` is not a valid attribute
120 --> $DIR/diagnostic-derive.rs:86:38
122 LL | #[diag(nonsense = 4, code = "E0123", slug = "foo")]
125 = help: only `code` is a valid nested attributes following the slug
127 error: diagnostic slug not specified
128 --> $DIR/diagnostic-derive.rs:86:1
130 LL | / #[diag(nonsense = 4, code = "E0123", slug = "foo")]
134 LL | | struct InvalidNestedStructAttr3 {}
135 | |__________________________________^
137 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
139 error: `#[diag(slug = ...)]` is not a valid attribute
140 --> $DIR/diagnostic-derive.rs:93:45
142 LL | #[diag(compiletest_example, code = "E0123", slug = "foo")]
145 = help: only `code` is a valid nested attributes following the slug
147 error: `#[suggestion = ...]` is not a valid attribute
148 --> $DIR/diagnostic-derive.rs:100:5
150 LL | #[suggestion = "bar"]
151 | ^^^^^^^^^^^^^^^^^^^^^
153 error: specified multiple times
154 --> $DIR/diagnostic-derive.rs:107:8
156 LL | #[diag(compiletest_example, code = "E0456")]
157 | ^^^^^^^^^^^^^^^^^^^
159 note: previously specified here
160 --> $DIR/diagnostic-derive.rs:106:8
162 LL | #[diag(compiletest_example, code = "E0123")]
163 | ^^^^^^^^^^^^^^^^^^^
165 error: specified multiple times
166 --> $DIR/diagnostic-derive.rs:107:36
168 LL | #[diag(compiletest_example, code = "E0456")]
171 note: previously specified here
172 --> $DIR/diagnostic-derive.rs:106:36
174 LL | #[diag(compiletest_example, code = "E0123")]
177 error: specified multiple times
178 --> $DIR/diagnostic-derive.rs:113:52
180 LL | #[diag(compiletest_example, code = "E0456", code = "E0457")]
183 note: previously specified here
184 --> $DIR/diagnostic-derive.rs:113:36
186 LL | #[diag(compiletest_example, code = "E0456", code = "E0457")]
189 error: `#[diag(compiletest_example)]` is not a valid attribute
190 --> $DIR/diagnostic-derive.rs:118:29
192 LL | #[diag(compiletest_example, compiletest_example, code = "E0456")]
193 | ^^^^^^^^^^^^^^^^^^^
195 = help: diagnostic slug must be the first argument
197 error: diagnostic slug not specified
198 --> $DIR/diagnostic-derive.rs:123:1
200 LL | struct KindNotProvided {}
201 | ^^^^^^^^^^^^^^^^^^^^^^^^^
203 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
205 error: diagnostic slug not specified
206 --> $DIR/diagnostic-derive.rs:126:1
208 LL | / #[diag(code = "E0456")]
210 LL | | struct SlugNotProvided {}
211 | |_________________________^
213 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
215 error: the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
216 --> $DIR/diagnostic-derive.rs:137:5
221 error: `#[nonsense]` is not a valid attribute
222 --> $DIR/diagnostic-derive.rs:145:5
227 error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
228 --> $DIR/diagnostic-derive.rs:162:5
233 error: `name` doesn't refer to a field on this type
234 --> $DIR/diagnostic-derive.rs:170:37
236 LL | #[suggestion(suggestion, code = "{name}")]
239 error: invalid format string: expected `'}'` but string was terminated
240 --> $DIR/diagnostic-derive.rs:175:10
242 LL | #[derive(Diagnostic)]
243 | ^^^^^^^^^^ expected `'}'` in format string
245 = note: if you intended to print `{`, you can escape it using `{{`
246 = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
248 error: invalid format string: unmatched `}` found
249 --> $DIR/diagnostic-derive.rs:185:10
251 LL | #[derive(Diagnostic)]
252 | ^^^^^^^^^^ unmatched `}` in format string
254 = note: if you intended to print `}`, you can escape it using `}}`
255 = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
257 error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
258 --> $DIR/diagnostic-derive.rs:205:5
263 error: suggestion without `code = "..."`
264 --> $DIR/diagnostic-derive.rs:223:5
266 LL | #[suggestion(suggestion)]
267 | ^^^^^^^^^^^^^^^^^^^^^^^^^
269 error: `#[suggestion(nonsense = ...)]` is not a valid attribute
270 --> $DIR/diagnostic-derive.rs:231:18
272 LL | #[suggestion(nonsense = "bar")]
275 = help: only `code` and `applicability` are valid nested attributes
277 error: suggestion without `code = "..."`
278 --> $DIR/diagnostic-derive.rs:231:5
280 LL | #[suggestion(nonsense = "bar")]
281 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
283 error: `#[suggestion(msg = ...)]` is not a valid attribute
284 --> $DIR/diagnostic-derive.rs:240:18
286 LL | #[suggestion(msg = "bar")]
289 = help: only `code` and `applicability` are valid nested attributes
291 error: suggestion without `code = "..."`
292 --> $DIR/diagnostic-derive.rs:240:5
294 LL | #[suggestion(msg = "bar")]
295 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
297 error: wrong field type for suggestion
298 --> $DIR/diagnostic-derive.rs:263:5
300 LL | / #[suggestion(suggestion, code = "This is suggested code")]
302 LL | | suggestion: Applicability,
303 | |_____________________________^
305 = help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`
307 error: specified multiple times
308 --> $DIR/diagnostic-derive.rs:279:24
310 LL | suggestion: (Span, Span, Applicability),
313 note: previously specified here
314 --> $DIR/diagnostic-derive.rs:279:18
316 LL | suggestion: (Span, Span, Applicability),
319 error: specified multiple times
320 --> $DIR/diagnostic-derive.rs:287:33
322 LL | suggestion: (Applicability, Applicability, Span),
325 note: previously specified here
326 --> $DIR/diagnostic-derive.rs:287:18
328 LL | suggestion: (Applicability, Applicability, Span),
331 error: `#[label = ...]` is not a valid attribute
332 --> $DIR/diagnostic-derive.rs:294:5
334 LL | #[label = "bar"]
337 error: specified multiple times
338 --> $DIR/diagnostic-derive.rs:445:44
340 LL | #[suggestion(suggestion, code = "...", applicability = "maybe-incorrect")]
341 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
343 note: previously specified here
344 --> $DIR/diagnostic-derive.rs:447:24
346 LL | suggestion: (Span, Applicability),
349 error: invalid applicability
350 --> $DIR/diagnostic-derive.rs:453:44
352 LL | #[suggestion(suggestion, code = "...", applicability = "batman")]
353 | ^^^^^^^^^^^^^^^^^^^^^^^^
355 error: `#[label(foo)]` is not a valid attribute
356 --> $DIR/diagnostic-derive.rs:516:20
358 LL | #[label(label, foo)]
361 = help: a diagnostic slug must be the first argument to the attribute
363 error: `#[label(foo = ...)]` is not a valid attribute
364 --> $DIR/diagnostic-derive.rs:524:20
366 LL | #[label(label, foo = "...")]
369 error: `#[label(foo(...))]` is not a valid attribute
370 --> $DIR/diagnostic-derive.rs:532:20
372 LL | #[label(label, foo("..."))]
375 error: `#[primary_span]` is not a valid attribute
376 --> $DIR/diagnostic-derive.rs:545:5
381 = help: the `primary_span` field attribute is not valid for lint diagnostics
383 error: `#[error(...)]` is not a valid attribute
384 --> $DIR/diagnostic-derive.rs:565:1
386 LL | #[error(compiletest_example, code = "E0123")]
387 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
389 error: diagnostic slug not specified
390 --> $DIR/diagnostic-derive.rs:565:1
392 LL | / #[error(compiletest_example, code = "E0123")]
396 LL | | struct ErrorAttribute {}
397 | |________________________^
399 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
401 error: `#[warn_(...)]` is not a valid attribute
402 --> $DIR/diagnostic-derive.rs:572:1
404 LL | #[warn_(compiletest_example, code = "E0123")]
405 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
407 error: diagnostic slug not specified
408 --> $DIR/diagnostic-derive.rs:572:1
410 LL | / #[warn_(compiletest_example, code = "E0123")]
414 LL | | struct WarnAttribute {}
415 | |_______________________^
417 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
419 error: `#[lint(...)]` is not a valid attribute
420 --> $DIR/diagnostic-derive.rs:579:1
422 LL | #[lint(compiletest_example, code = "E0123")]
423 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
425 error: diagnostic slug not specified
426 --> $DIR/diagnostic-derive.rs:579:1
428 LL | / #[lint(compiletest_example, code = "E0123")]
432 LL | | struct LintAttributeOnSessionDiag {}
433 | |____________________________________^
435 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
437 error: `#[lint(...)]` is not a valid attribute
438 --> $DIR/diagnostic-derive.rs:586:1
440 LL | #[lint(compiletest_example, code = "E0123")]
441 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
443 error: `#[lint(...)]` is not a valid attribute
444 --> $DIR/diagnostic-derive.rs:586:1
446 LL | #[lint(compiletest_example, code = "E0123")]
447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
449 error: diagnostic slug not specified
450 --> $DIR/diagnostic-derive.rs:586:1
452 LL | / #[lint(compiletest_example, code = "E0123")]
457 LL | | struct LintAttributeOnLintDiag {}
458 | |_________________________________^
460 = help: specify the slug as the first argument to the attribute, such as `#[diag(compiletest_example)]`
462 error: specified multiple times
463 --> $DIR/diagnostic-derive.rs:596:44
465 LL | #[suggestion(suggestion, code = "...", code = ",,,")]
468 note: previously specified here
469 --> $DIR/diagnostic-derive.rs:596:30
471 LL | #[suggestion(suggestion, code = "...", code = ",,,")]
474 error: wrong types for suggestion
475 --> $DIR/diagnostic-derive.rs:605:24
477 LL | suggestion: (Span, usize),
480 = help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
482 error: wrong types for suggestion
483 --> $DIR/diagnostic-derive.rs:613:17
485 LL | suggestion: (Span,),
488 = help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
490 error: suggestion without `code = "..."`
491 --> $DIR/diagnostic-derive.rs:620:5
493 LL | #[suggestion(suggestion)]
494 | ^^^^^^^^^^^^^^^^^^^^^^^^^
496 error: `#[multipart_suggestion(...)]` is not a valid attribute
497 --> $DIR/diagnostic-derive.rs:627:1
499 LL | #[multipart_suggestion(suggestion)]
500 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
502 = help: consider creating a `Subdiagnostic` instead
504 error: `#[multipart_suggestion(...)]` is not a valid attribute
505 --> $DIR/diagnostic-derive.rs:630:1
507 LL | #[multipart_suggestion()]
508 | ^^^^^^^^^^^^^^^^^^^^^^^^^
510 = help: consider creating a `Subdiagnostic` instead
512 error: `#[multipart_suggestion(...)]` is not a valid attribute
513 --> $DIR/diagnostic-derive.rs:634:5
515 LL | #[multipart_suggestion(suggestion)]
516 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
518 = help: consider creating a `Subdiagnostic` instead
520 error: `#[suggestion(...)]` is not a valid attribute
521 --> $DIR/diagnostic-derive.rs:642:1
523 LL | #[suggestion(suggestion, code = "...")]
524 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
526 = help: `#[label]` and `#[suggestion]` can only be applied to fields
528 error: `#[label]` is not a valid attribute
529 --> $DIR/diagnostic-derive.rs:651:1
534 = help: `#[label]` and `#[suggestion]` can only be applied to fields
536 error: `#[subdiagnostic(bad)]` is not a valid attribute
537 --> $DIR/diagnostic-derive.rs:685:21
539 LL | #[subdiagnostic(bad)]
542 = help: `eager` is the only supported nested attribute for `subdiagnostic`
544 error: `#[subdiagnostic = ...]` is not a valid attribute
545 --> $DIR/diagnostic-derive.rs:693:5
547 LL | #[subdiagnostic = "bad"]
548 | ^^^^^^^^^^^^^^^^^^^^^^^^
550 = help: `eager` is the only supported nested attribute for `subdiagnostic`
552 error: `#[subdiagnostic(...)]` is not a valid attribute
553 --> $DIR/diagnostic-derive.rs:701:5
555 LL | #[subdiagnostic(bad, bad)]
556 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
558 = help: `eager` is the only supported nested attribute for `subdiagnostic`
560 error: `#[subdiagnostic("...")]` is not a valid attribute
561 --> $DIR/diagnostic-derive.rs:709:21
563 LL | #[subdiagnostic("bad")]
566 = help: `eager` is the only supported nested attribute for `subdiagnostic`
568 error: `#[subdiagnostic(...)]` is not a valid attribute
569 --> $DIR/diagnostic-derive.rs:717:5
571 LL | #[subdiagnostic(eager)]
572 | ^^^^^^^^^^^^^^^^^^^^^^^
574 = help: eager subdiagnostics are not supported on lints
576 error: expected at least one string literal for `code(...)`
577 --> $DIR/diagnostic-derive.rs:779:18
579 LL | #[suggestion(code())]
582 error: `code(...)` must contain only string literals
583 --> $DIR/diagnostic-derive.rs:787:23
585 LL | #[suggestion(code(foo))]
588 error: `code = "..."`/`code(...)` must contain only string literals
589 --> $DIR/diagnostic-derive.rs:795:18
591 LL | #[suggestion(code = 3)]
594 error: cannot find attribute `nonsense` in this scope
595 --> $DIR/diagnostic-derive.rs:55:3
597 LL | #[nonsense(compiletest_example, code = "E0123")]
600 error: cannot find attribute `nonsense` in this scope
601 --> $DIR/diagnostic-derive.rs:145:7
606 error: cannot find attribute `error` in this scope
607 --> $DIR/diagnostic-derive.rs:565:3
609 LL | #[error(compiletest_example, code = "E0123")]
612 error: cannot find attribute `warn_` in this scope
613 --> $DIR/diagnostic-derive.rs:572:3
615 LL | #[warn_(compiletest_example, code = "E0123")]
616 | ^^^^^ help: a built-in attribute with a similar name exists: `warn`
618 error: cannot find attribute `lint` in this scope
619 --> $DIR/diagnostic-derive.rs:579:3
621 LL | #[lint(compiletest_example, code = "E0123")]
622 | ^^^^ help: a built-in attribute with a similar name exists: `link`
624 error: cannot find attribute `lint` in this scope
625 --> $DIR/diagnostic-derive.rs:586:3
627 LL | #[lint(compiletest_example, code = "E0123")]
628 | ^^^^ help: a built-in attribute with a similar name exists: `link`
630 error: cannot find attribute `multipart_suggestion` in this scope
631 --> $DIR/diagnostic-derive.rs:627:3
633 LL | #[multipart_suggestion(suggestion)]
634 | ^^^^^^^^^^^^^^^^^^^^
636 error: cannot find attribute `multipart_suggestion` in this scope
637 --> $DIR/diagnostic-derive.rs:630:3
639 LL | #[multipart_suggestion()]
640 | ^^^^^^^^^^^^^^^^^^^^
642 error: cannot find attribute `multipart_suggestion` in this scope
643 --> $DIR/diagnostic-derive.rs:634:7
645 LL | #[multipart_suggestion(suggestion)]
646 | ^^^^^^^^^^^^^^^^^^^^
648 error[E0425]: cannot find value `nonsense` in module `rustc_errors::fluent`
649 --> $DIR/diagnostic-derive.rs:68:8
651 LL | #[diag(nonsense, code = "E0123")]
652 | ^^^^^^^^ not found in `rustc_errors::fluent`
654 error[E0277]: the trait bound `Hello: IntoDiagnosticArg` is not satisfied
655 --> $DIR/diagnostic-derive.rs:338:10
657 LL | #[derive(Diagnostic)]
658 | ^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `Hello`
660 = help: normalized in stderr
661 note: required by a bound in `DiagnosticBuilder::<'a, G>::set_arg`
662 --> $COMPILER_DIR/rustc_errors/src/diagnostic_builder.rs:LL:CC
664 LL | arg: impl IntoDiagnosticArg,
665 | ^^^^^^^^^^^^^^^^^ required by this bound in `DiagnosticBuilder::<'a, G>::set_arg`
666 = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
668 error: aborting due to 83 previous errors
670 Some errors have detailed explanations: E0277, E0425.
671 For more information about an error, try `rustc --explain E0277`.