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: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
260 LL | #[label(typeck::label)]
261 | ^^^^^^^^^^^^^^^^^^^^^^^
263 error: suggestion without `code = "..."`
264 --> $DIR/diagnostic-derive.rs:223:5
266 LL | #[suggestion(typeck::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(typeck::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:52
340 LL | #[suggestion(typeck::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:52
352 LL | #[suggestion(typeck::suggestion, code = "...", applicability = "batman")]
353 | ^^^^^^^^^^^^^^^^^^^^^^^^
355 error: `#[label(foo)]` is not a valid attribute
356 --> $DIR/diagnostic-derive.rs:516:28
358 LL | #[label(typeck::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:28
366 LL | #[label(typeck::label, foo = "...")]
369 error: `#[label(foo(...))]` is not a valid attribute
370 --> $DIR/diagnostic-derive.rs:532:28
372 LL | #[label(typeck::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(typeck::ambiguous_lifetime_bound, code = "E0123")]
387 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
389 error: diagnostic slug not specified
390 --> $DIR/diagnostic-derive.rs:565:1
392 LL | / #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
396 LL | | struct ErrorAttribute {}
397 | |________________________^
399 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
401 error: `#[warn_(...)]` is not a valid attribute
402 --> $DIR/diagnostic-derive.rs:572:1
404 LL | #[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")]
405 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
407 error: diagnostic slug not specified
408 --> $DIR/diagnostic-derive.rs:572:1
410 LL | / #[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")]
414 LL | | struct WarnAttribute {}
415 | |_______________________^
417 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
419 error: `#[lint(...)]` is not a valid attribute
420 --> $DIR/diagnostic-derive.rs:579:1
422 LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
423 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
425 error: diagnostic slug not specified
426 --> $DIR/diagnostic-derive.rs:579:1
428 LL | / #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
432 LL | | struct LintAttributeOnSessionDiag {}
433 | |____________________________________^
435 = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
437 error: `#[lint(...)]` is not a valid attribute
438 --> $DIR/diagnostic-derive.rs:586:1
440 LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
441 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
443 error: diagnostic slug not specified
444 --> $DIR/diagnostic-derive.rs:586:1
446 LL | / #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
450 LL | | struct LintAttributeOnLintDiag {}
451 | |_________________________________^
453 = help: specify the slug as the first argument to the attribute, such as `#[diag(typeck::example_error)]`
455 error: specified multiple times
456 --> $DIR/diagnostic-derive.rs:595:52
458 LL | #[suggestion(typeck::suggestion, code = "...", code = ",,,")]
461 note: previously specified here
462 --> $DIR/diagnostic-derive.rs:595:38
464 LL | #[suggestion(typeck::suggestion, code = "...", code = ",,,")]
467 error: wrong types for suggestion
468 --> $DIR/diagnostic-derive.rs:604:24
470 LL | suggestion: (Span, usize),
473 = help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
475 error: wrong types for suggestion
476 --> $DIR/diagnostic-derive.rs:612:17
478 LL | suggestion: (Span,),
481 = help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
483 error: suggestion without `code = "..."`
484 --> $DIR/diagnostic-derive.rs:619:5
486 LL | #[suggestion(typeck::suggestion)]
487 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
489 error: `#[multipart_suggestion(...)]` is not a valid attribute
490 --> $DIR/diagnostic-derive.rs:626:1
492 LL | #[multipart_suggestion(typeck::suggestion)]
493 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
495 = help: consider creating a `Subdiagnostic` instead
497 error: `#[multipart_suggestion(...)]` is not a valid attribute
498 --> $DIR/diagnostic-derive.rs:629:1
500 LL | #[multipart_suggestion()]
501 | ^^^^^^^^^^^^^^^^^^^^^^^^^
503 = help: consider creating a `Subdiagnostic` instead
505 error: `#[multipart_suggestion(...)]` is not a valid attribute
506 --> $DIR/diagnostic-derive.rs:633:5
508 LL | #[multipart_suggestion(typeck::suggestion)]
509 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
511 = help: consider creating a `Subdiagnostic` instead
513 error: `#[suggestion(...)]` is not a valid attribute
514 --> $DIR/diagnostic-derive.rs:641:1
516 LL | #[suggestion(typeck::suggestion, code = "...")]
517 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
519 = help: `#[label]` and `#[suggestion]` can only be applied to fields
521 error: `#[label]` is not a valid attribute
522 --> $DIR/diagnostic-derive.rs:650:1
527 = help: `#[label]` and `#[suggestion]` can only be applied to fields
529 error: cannot find attribute `nonsense` in this scope
530 --> $DIR/diagnostic-derive.rs:55:3
532 LL | #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")]
535 error: cannot find attribute `nonsense` in this scope
536 --> $DIR/diagnostic-derive.rs:145:7
541 error: cannot find attribute `error` in this scope
542 --> $DIR/diagnostic-derive.rs:565:3
544 LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
547 error: cannot find attribute `warn_` in this scope
548 --> $DIR/diagnostic-derive.rs:572:3
550 LL | #[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")]
551 | ^^^^^ help: a built-in attribute with a similar name exists: `warn`
553 error: cannot find attribute `lint` in this scope
554 --> $DIR/diagnostic-derive.rs:579:3
556 LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
557 | ^^^^ help: a built-in attribute with a similar name exists: `link`
559 error: cannot find attribute `lint` in this scope
560 --> $DIR/diagnostic-derive.rs:586:3
562 LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
563 | ^^^^ help: a built-in attribute with a similar name exists: `link`
565 error: cannot find attribute `multipart_suggestion` in this scope
566 --> $DIR/diagnostic-derive.rs:626:3
568 LL | #[multipart_suggestion(typeck::suggestion)]
569 | ^^^^^^^^^^^^^^^^^^^^
571 error: cannot find attribute `multipart_suggestion` in this scope
572 --> $DIR/diagnostic-derive.rs:629:3
574 LL | #[multipart_suggestion()]
575 | ^^^^^^^^^^^^^^^^^^^^
577 error: cannot find attribute `multipart_suggestion` in this scope
578 --> $DIR/diagnostic-derive.rs:633:7
580 LL | #[multipart_suggestion(typeck::suggestion)]
581 | ^^^^^^^^^^^^^^^^^^^^
583 error[E0425]: cannot find value `nonsense` in module `rustc_errors::fluent`
584 --> $DIR/diagnostic-derive.rs:68:8
586 LL | #[diag(nonsense, code = "E0123")]
587 | ^^^^^^^^ not found in `rustc_errors::fluent`
589 error[E0277]: the trait bound `Hello: IntoDiagnosticArg` is not satisfied
590 --> $DIR/diagnostic-derive.rs:338:10
592 LL | #[derive(Diagnostic)]
593 | ^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `Hello`
595 = help: normalized in stderr
596 note: required by a bound in `DiagnosticBuilder::<'a, G>::set_arg`
597 --> $COMPILER_DIR/rustc_errors/src/diagnostic_builder.rs:LL:CC
599 LL | arg: impl IntoDiagnosticArg,
600 | ^^^^^^^^^^^^^^^^^ required by this bound in `DiagnosticBuilder::<'a, G>::set_arg`
601 = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
603 error: aborting due to 74 previous errors
605 Some errors have detailed explanations: E0277, E0425.
606 For more information about an error, try `rustc --explain E0277`.