1 error: unsupported type attribute for diagnostic derive enum
2 --> $DIR/diagnostic-derive.rs:39:1
4 LL | #[diag(typeck::ambiguous_lifetime_bound, 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(typeck::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(typeck::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(typeck::ambiguous_lifetime_bound, code = "E0123")]
33 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35 error: diagnostic slug not specified
36 --> $DIR/diagnostic-derive.rs:55:1
38 LL | / #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")]
42 LL | | struct InvalidStructAttr {}
43 | |___________________________^
45 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::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(typeck::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(typeck::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(typeck::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(typeck::example_error)]`
139 error: `#[diag(slug = ...)]` is not a valid attribute
140 --> $DIR/diagnostic-derive.rs:93:58
142 LL | #[diag(typeck::ambiguous_lifetime_bound, 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(typeck::ambiguous_lifetime_bound, code = "E0456")]
157 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
159 note: previously specified here
160 --> $DIR/diagnostic-derive.rs:106:8
162 LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
163 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
165 error: specified multiple times
166 --> $DIR/diagnostic-derive.rs:107:49
168 LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456")]
171 note: previously specified here
172 --> $DIR/diagnostic-derive.rs:106:49
174 LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
177 error: specified multiple times
178 --> $DIR/diagnostic-derive.rs:113:65
180 LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")]
183 note: previously specified here
184 --> $DIR/diagnostic-derive.rs:113:49
186 LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")]
189 error: `#[diag(typeck::ambiguous_lifetime_bound)]` is not a valid attribute
190 --> $DIR/diagnostic-derive.rs:118:42
192 LL | #[diag(typeck::ambiguous_lifetime_bound, typeck::ambiguous_lifetime_bound, 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(typeck::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(typeck::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
230 LL | #[label(typeck::label)]
231 | ^^^^^^^^^^^^^^^^^^^^^^^
233 error: `name` doesn't refer to a field on this type
234 --> $DIR/diagnostic-derive.rs:170:45
236 LL | #[suggestion(typeck::suggestion, code = "{name}")]
239 error: invalid format string: expected `'}'` but string was terminated
240 --> $DIR/diagnostic-derive.rs:175:16
242 LL | #[derive(Diagnostic)]
243 | - ^ expected `'}'` in format string
245 | because of this opening brace
247 = note: if you intended to print `{`, you can escape it using `{{`
248 = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
250 error: invalid format string: unmatched `}` found
251 --> $DIR/diagnostic-derive.rs:185:15
253 LL | #[derive(Diagnostic)]
254 | ^ unmatched `}` in format string
256 = note: if you intended to print `}`, you can escape it using `}}`
257 = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
259 error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
260 --> $DIR/diagnostic-derive.rs:205:5
262 LL | #[label(typeck::label)]
263 | ^^^^^^^^^^^^^^^^^^^^^^^
265 error: suggestion without `code = "..."`
266 --> $DIR/diagnostic-derive.rs:223:5
268 LL | #[suggestion(typeck::suggestion)]
269 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
271 error: `#[suggestion(nonsense = ...)]` is not a valid attribute
272 --> $DIR/diagnostic-derive.rs:231:18
274 LL | #[suggestion(nonsense = "bar")]
277 = help: only `code` and `applicability` are valid nested attributes
279 error: suggestion without `code = "..."`
280 --> $DIR/diagnostic-derive.rs:231:5
282 LL | #[suggestion(nonsense = "bar")]
283 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
285 error: `#[suggestion(msg = ...)]` is not a valid attribute
286 --> $DIR/diagnostic-derive.rs:240:18
288 LL | #[suggestion(msg = "bar")]
291 = help: only `code` and `applicability` are valid nested attributes
293 error: suggestion without `code = "..."`
294 --> $DIR/diagnostic-derive.rs:240:5
296 LL | #[suggestion(msg = "bar")]
297 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
299 error: wrong field type for suggestion
300 --> $DIR/diagnostic-derive.rs:263:5
302 LL | / #[suggestion(typeck::suggestion, code = "This is suggested code")]
304 LL | | suggestion: Applicability,
305 | |_____________________________^
307 = help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`
309 error: specified multiple times
310 --> $DIR/diagnostic-derive.rs:279:24
312 LL | suggestion: (Span, Span, Applicability),
315 note: previously specified here
316 --> $DIR/diagnostic-derive.rs:279:18
318 LL | suggestion: (Span, Span, Applicability),
321 error: specified multiple times
322 --> $DIR/diagnostic-derive.rs:287:33
324 LL | suggestion: (Applicability, Applicability, Span),
327 note: previously specified here
328 --> $DIR/diagnostic-derive.rs:287:18
330 LL | suggestion: (Applicability, Applicability, Span),
333 error: `#[label = ...]` is not a valid attribute
334 --> $DIR/diagnostic-derive.rs:294:5
336 LL | #[label = "bar"]
339 error: specified multiple times
340 --> $DIR/diagnostic-derive.rs:445:52
342 LL | #[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")]
343 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
345 note: previously specified here
346 --> $DIR/diagnostic-derive.rs:447:24
348 LL | suggestion: (Span, Applicability),
351 error: invalid applicability
352 --> $DIR/diagnostic-derive.rs:453:52
354 LL | #[suggestion(typeck::suggestion, code = "...", applicability = "batman")]
355 | ^^^^^^^^^^^^^^^^^^^^^^^^
357 error: `#[label(foo)]` is not a valid attribute
358 --> $DIR/diagnostic-derive.rs:516:28
360 LL | #[label(typeck::label, foo)]
363 = help: a diagnostic slug must be the first argument to the attribute
365 error: `#[label(foo = ...)]` is not a valid attribute
366 --> $DIR/diagnostic-derive.rs:524:28
368 LL | #[label(typeck::label, foo = "...")]
371 error: `#[label(foo(...))]` is not a valid attribute
372 --> $DIR/diagnostic-derive.rs:532:28
374 LL | #[label(typeck::label, foo("..."))]
377 error: `#[primary_span]` is not a valid attribute
378 --> $DIR/diagnostic-derive.rs:545:5
383 = help: the `primary_span` field attribute is not valid for lint diagnostics
385 error: `#[error(...)]` is not a valid attribute
386 --> $DIR/diagnostic-derive.rs:565:1
388 LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
389 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
391 error: diagnostic slug not specified
392 --> $DIR/diagnostic-derive.rs:565:1
394 LL | / #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
398 LL | | struct ErrorAttribute {}
399 | |________________________^
401 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
403 error: `#[warn_(...)]` is not a valid attribute
404 --> $DIR/diagnostic-derive.rs:572:1
406 LL | #[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")]
407 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
409 error: diagnostic slug not specified
410 --> $DIR/diagnostic-derive.rs:572:1
412 LL | / #[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")]
416 LL | | struct WarnAttribute {}
417 | |_______________________^
419 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
421 error: `#[lint(...)]` is not a valid attribute
422 --> $DIR/diagnostic-derive.rs:579:1
424 LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
425 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
427 error: diagnostic slug not specified
428 --> $DIR/diagnostic-derive.rs:579:1
430 LL | / #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
434 LL | | struct LintAttributeOnSessionDiag {}
435 | |____________________________________^
437 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
439 error: `#[lint(...)]` is not a valid attribute
440 --> $DIR/diagnostic-derive.rs:586:1
442 LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
443 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
445 error: diagnostic slug not specified
446 --> $DIR/diagnostic-derive.rs:586:1
448 LL | / #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
452 LL | | struct LintAttributeOnLintDiag {}
453 | |_________________________________^
455 = help: specify the slug as the first argument to the attribute, such as `#[diag(typeck::example_error)]`
457 error: specified multiple times
458 --> $DIR/diagnostic-derive.rs:595:52
460 LL | #[suggestion(typeck::suggestion, code = "...", code = ",,,")]
463 note: previously specified here
464 --> $DIR/diagnostic-derive.rs:595:38
466 LL | #[suggestion(typeck::suggestion, code = "...", code = ",,,")]
469 error: wrong types for suggestion
470 --> $DIR/diagnostic-derive.rs:604:24
472 LL | suggestion: (Span, usize),
475 = help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
477 error: wrong types for suggestion
478 --> $DIR/diagnostic-derive.rs:612:17
480 LL | suggestion: (Span,),
483 = help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
485 error: suggestion without `code = "..."`
486 --> $DIR/diagnostic-derive.rs:619:5
488 LL | #[suggestion(typeck::suggestion)]
489 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
491 error: `#[multipart_suggestion(...)]` is not a valid attribute
492 --> $DIR/diagnostic-derive.rs:626:1
494 LL | #[multipart_suggestion(typeck::suggestion)]
495 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
497 = help: consider creating a `Subdiagnostic` instead
499 error: `#[multipart_suggestion(...)]` is not a valid attribute
500 --> $DIR/diagnostic-derive.rs:629:1
502 LL | #[multipart_suggestion()]
503 | ^^^^^^^^^^^^^^^^^^^^^^^^^
505 = help: consider creating a `Subdiagnostic` instead
507 error: `#[multipart_suggestion(...)]` is not a valid attribute
508 --> $DIR/diagnostic-derive.rs:633:5
510 LL | #[multipart_suggestion(typeck::suggestion)]
511 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
513 = help: consider creating a `Subdiagnostic` instead
515 error: `#[suggestion(...)]` is not a valid attribute
516 --> $DIR/diagnostic-derive.rs:641:1
518 LL | #[suggestion(typeck::suggestion, code = "...")]
519 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
521 = help: `#[label]` and `#[suggestion]` can only be applied to fields
523 error: `#[label]` is not a valid attribute
524 --> $DIR/diagnostic-derive.rs:650:1
529 = help: `#[label]` and `#[suggestion]` can only be applied to fields
531 error: cannot find attribute `nonsense` in this scope
532 --> $DIR/diagnostic-derive.rs:55:3
534 LL | #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")]
537 error: cannot find attribute `nonsense` in this scope
538 --> $DIR/diagnostic-derive.rs:145:7
543 error: cannot find attribute `error` in this scope
544 --> $DIR/diagnostic-derive.rs:565:3
546 LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
549 error: cannot find attribute `warn_` in this scope
550 --> $DIR/diagnostic-derive.rs:572:3
552 LL | #[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")]
553 | ^^^^^ help: a built-in attribute with a similar name exists: `warn`
555 error: cannot find attribute `lint` in this scope
556 --> $DIR/diagnostic-derive.rs:579:3
558 LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
559 | ^^^^ help: a built-in attribute with a similar name exists: `link`
561 error: cannot find attribute `lint` in this scope
562 --> $DIR/diagnostic-derive.rs:586:3
564 LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
565 | ^^^^ help: a built-in attribute with a similar name exists: `link`
567 error: cannot find attribute `multipart_suggestion` in this scope
568 --> $DIR/diagnostic-derive.rs:626:3
570 LL | #[multipart_suggestion(typeck::suggestion)]
571 | ^^^^^^^^^^^^^^^^^^^^
573 error: cannot find attribute `multipart_suggestion` in this scope
574 --> $DIR/diagnostic-derive.rs:629:3
576 LL | #[multipart_suggestion()]
577 | ^^^^^^^^^^^^^^^^^^^^
579 error: cannot find attribute `multipart_suggestion` in this scope
580 --> $DIR/diagnostic-derive.rs:633:7
582 LL | #[multipart_suggestion(typeck::suggestion)]
583 | ^^^^^^^^^^^^^^^^^^^^
585 error[E0425]: cannot find value `nonsense` in module `rustc_errors::fluent`
586 --> $DIR/diagnostic-derive.rs:68:8
588 LL | #[diag(nonsense, code = "E0123")]
589 | ^^^^^^^^ not found in `rustc_errors::fluent`
591 error[E0277]: the trait bound `Hello: IntoDiagnosticArg` is not satisfied
592 --> $DIR/diagnostic-derive.rs:338:10
594 LL | #[derive(Diagnostic)]
595 | ^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `Hello`
597 = help: normalized in stderr
598 note: required by a bound in `DiagnosticBuilder::<'a, G>::set_arg`
599 --> $COMPILER_DIR/rustc_errors/src/diagnostic_builder.rs:LL:CC
601 LL | arg: impl IntoDiagnosticArg,
602 | ^^^^^^^^^^^^^^^^^ required by this bound in `DiagnosticBuilder::<'a, G>::set_arg`
603 = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
605 error: aborting due to 74 previous errors
607 Some errors have detailed explanations: E0277, E0425.
608 For more information about an error, try `rustc --explain E0277`.