]> git.lizzy.rs Git - rust.git/blob - src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
rustdoc: remove unused CSS `#results > table`
[rust.git] / src / test / ui-fulldeps / session-diagnostic / diagnostic-derive.stderr
1 error: `#[derive(SessionDiagnostic)]` can only be used on structs
2   --> $DIR/diagnostic-derive.rs:39:1
3    |
4 LL | / #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
5 LL | |
6 LL | | enum SessionDiagnosticOnEnum {
7 LL | |     Foo,
8 LL | |     Bar,
9 LL | | }
10    | |_^
11
12 error: `#[diag = ...]` is not a valid attribute
13   --> $DIR/diagnostic-derive.rs:48:1
14    |
15 LL | #[diag = "E0123"]
16    | ^^^^^^^^^^^^^^^^^
17
18 error: `#[nonsense(...)]` is not a valid attribute
19   --> $DIR/diagnostic-derive.rs:53:1
20    |
21 LL | #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")]
22    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23    |
24    = help: only `diag`, `help`, `note` and `warning` are valid attributes
25
26 error: diagnostic slug not specified
27   --> $DIR/diagnostic-derive.rs:53:1
28    |
29 LL | / #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")]
30 LL | |
31 LL | |
32 LL | |
33 LL | | struct InvalidStructAttr {}
34    | |___________________________^
35    |
36    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
37
38 error: `#[diag("...")]` is not a valid attribute
39   --> $DIR/diagnostic-derive.rs:60:8
40    |
41 LL | #[diag("E0123")]
42    |        ^^^^^^^
43    |
44    = help: first argument of the attribute should be the diagnostic slug
45
46 error: diagnostic slug not specified
47   --> $DIR/diagnostic-derive.rs:60:1
48    |
49 LL | / #[diag("E0123")]
50 LL | |
51 LL | |
52 LL | | struct InvalidLitNestedAttr {}
53    | |______________________________^
54    |
55    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
56
57 error: `#[diag(nonsense(...))]` is not a valid attribute
58   --> $DIR/diagnostic-derive.rs:71:8
59    |
60 LL | #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
61    |        ^^^^^^^^^^^^^^^
62    |
63    = help: first argument of the attribute should be the diagnostic slug
64
65 error: diagnostic slug not specified
66   --> $DIR/diagnostic-derive.rs:71:1
67    |
68 LL | / #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
69 LL | |
70 LL | |
71 LL | | struct InvalidNestedStructAttr1 {}
72    | |__________________________________^
73    |
74    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
75
76 error: `#[diag(nonsense = ...)]` is not a valid attribute
77   --> $DIR/diagnostic-derive.rs:77:8
78    |
79 LL | #[diag(nonsense = "...", code = "E0123", slug = "foo")]
80    |        ^^^^^^^^^^^^^^^^
81    |
82    = help: first argument of the attribute should be the diagnostic slug
83
84 error: diagnostic slug not specified
85   --> $DIR/diagnostic-derive.rs:77:1
86    |
87 LL | / #[diag(nonsense = "...", code = "E0123", slug = "foo")]
88 LL | |
89 LL | |
90 LL | | struct InvalidNestedStructAttr2 {}
91    | |__________________________________^
92    |
93    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
94
95 error: `#[diag(nonsense = ...)]` is not a valid attribute
96   --> $DIR/diagnostic-derive.rs:83:8
97    |
98 LL | #[diag(nonsense = 4, code = "E0123", slug = "foo")]
99    |        ^^^^^^^^^^^^
100    |
101    = help: first argument of the attribute should be the diagnostic slug
102
103 error: diagnostic slug not specified
104   --> $DIR/diagnostic-derive.rs:83:1
105    |
106 LL | / #[diag(nonsense = 4, code = "E0123", slug = "foo")]
107 LL | |
108 LL | |
109 LL | | struct InvalidNestedStructAttr3 {}
110    | |__________________________________^
111    |
112    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
113
114 error: `#[diag(slug = ...)]` is not a valid attribute
115   --> $DIR/diagnostic-derive.rs:89:58
116    |
117 LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123", slug = "foo")]
118    |                                                          ^^^^^^^^^^^^
119    |
120    = help: only `code` is a valid nested attributes following the slug
121
122 error: `#[suggestion = ...]` is not a valid attribute
123   --> $DIR/diagnostic-derive.rs:96:5
124    |
125 LL |     #[suggestion = "bar"]
126    |     ^^^^^^^^^^^^^^^^^^^^^
127
128 error: specified multiple times
129   --> $DIR/diagnostic-derive.rs:103:1
130    |
131 LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456")]
132    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
133    |
134 note: previously specified here
135   --> $DIR/diagnostic-derive.rs:102:1
136    |
137 LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
138    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139
140 error: specified multiple times
141   --> $DIR/diagnostic-derive.rs:103:49
142    |
143 LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456")]
144    |                                                 ^^^^^^^
145    |
146 note: previously specified here
147   --> $DIR/diagnostic-derive.rs:102:49
148    |
149 LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
150    |                                                 ^^^^^^^
151
152 error: specified multiple times
153   --> $DIR/diagnostic-derive.rs:109:65
154    |
155 LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")]
156    |                                                                 ^^^^^^^
157    |
158 note: previously specified here
159   --> $DIR/diagnostic-derive.rs:109:49
160    |
161 LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")]
162    |                                                 ^^^^^^^
163
164 error: `#[diag(typeck::ambiguous_lifetime_bound)]` is not a valid attribute
165   --> $DIR/diagnostic-derive.rs:114:42
166    |
167 LL | #[diag(typeck::ambiguous_lifetime_bound, typeck::ambiguous_lifetime_bound, code = "E0456")]
168    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
169
170 error: diagnostic slug not specified
171   --> $DIR/diagnostic-derive.rs:119:1
172    |
173 LL | struct KindNotProvided {}
174    | ^^^^^^^^^^^^^^^^^^^^^^^^^
175    |
176    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
177
178 error: diagnostic slug not specified
179   --> $DIR/diagnostic-derive.rs:122:1
180    |
181 LL | / #[diag(code = "E0456")]
182 LL | |
183 LL | | struct SlugNotProvided {}
184    | |_________________________^
185    |
186    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
187
188 error: the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
189   --> $DIR/diagnostic-derive.rs:133:5
190    |
191 LL |     #[primary_span]
192    |     ^^^^^^^^^^^^^^^
193
194 error: `#[nonsense]` is not a valid attribute
195   --> $DIR/diagnostic-derive.rs:141:5
196    |
197 LL |     #[nonsense]
198    |     ^^^^^^^^^^^
199    |
200    = help: only `skip_arg`, `primary_span`, `label`, `note`, `help` and `subdiagnostic` are valid field attributes
201
202 error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
203   --> $DIR/diagnostic-derive.rs:158:5
204    |
205 LL |     #[label(typeck::label)]
206    |     ^^^^^^^^^^^^^^^^^^^^^^^
207
208 error: `name` doesn't refer to a field on this type
209   --> $DIR/diagnostic-derive.rs:166:45
210    |
211 LL |     #[suggestion(typeck::suggestion, code = "{name}")]
212    |                                             ^^^^^^^^
213
214 error: invalid format string: expected `'}'` but string was terminated
215   --> $DIR/diagnostic-derive.rs:171:16
216    |
217 LL | #[derive(SessionDiagnostic)]
218    |           -    ^ expected `'}'` in format string
219    |           |
220    |           because of this opening brace
221    |
222    = note: if you intended to print `{`, you can escape it using `{{`
223    = note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
224
225 error: invalid format string: unmatched `}` found
226   --> $DIR/diagnostic-derive.rs:181:15
227    |
228 LL | #[derive(SessionDiagnostic)]
229    |               ^ unmatched `}` in format string
230    |
231    = note: if you intended to print `}`, you can escape it using `}}`
232    = note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
233
234 error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
235   --> $DIR/diagnostic-derive.rs:201:5
236    |
237 LL |     #[label(typeck::label)]
238    |     ^^^^^^^^^^^^^^^^^^^^^^^
239
240 error: `#[suggestion(nonsense = ...)]` is not a valid attribute
241   --> $DIR/diagnostic-derive.rs:226:18
242    |
243 LL |     #[suggestion(nonsense = "bar")]
244    |                  ^^^^^^^^^^^^^^^^
245    |
246    = help: only `message`, `code` and `applicability` are valid field attributes
247
248 error: `#[suggestion(msg = ...)]` is not a valid attribute
249   --> $DIR/diagnostic-derive.rs:234:18
250    |
251 LL |     #[suggestion(msg = "bar")]
252    |                  ^^^^^^^^^^^
253    |
254    = help: only `message`, `code` and `applicability` are valid field attributes
255
256 error: wrong field type for suggestion
257   --> $DIR/diagnostic-derive.rs:256:5
258    |
259 LL | /     #[suggestion(typeck::suggestion, code = "This is suggested code")]
260 LL | |
261 LL | |     suggestion: Applicability,
262    | |_____________________________^
263    |
264    = help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`
265
266 error: type of field annotated with `#[suggestion(...)]` contains more than one `Span`
267   --> $DIR/diagnostic-derive.rs:271:5
268    |
269 LL | /     #[suggestion(typeck::suggestion, code = "This is suggested code")]
270 LL | |
271 LL | |     suggestion: (Span, Span, Applicability),
272    | |___________________________________________^
273
274 error: type of field annotated with `#[suggestion(...)]` contains more than one Applicability
275   --> $DIR/diagnostic-derive.rs:279:5
276    |
277 LL | /     #[suggestion(typeck::suggestion, code = "This is suggested code")]
278 LL | |
279 LL | |     suggestion: (Applicability, Applicability, Span),
280    | |____________________________________________________^
281
282 error: `#[label = ...]` is not a valid attribute
283   --> $DIR/diagnostic-derive.rs:287:5
284    |
285 LL |     #[label = "bar"]
286    |     ^^^^^^^^^^^^^^^^
287
288 error: applicability cannot be set in both the field and attribute
289   --> $DIR/diagnostic-derive.rs:438:52
290    |
291 LL |     #[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")]
292    |                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
293
294 error: invalid applicability
295   --> $DIR/diagnostic-derive.rs:446:52
296    |
297 LL |     #[suggestion(typeck::suggestion, code = "...", applicability = "batman")]
298    |                                                    ^^^^^^^^^^^^^^^^^^^^^^^^
299
300 error: `#[label(...)]` is not a valid attribute
301   --> $DIR/diagnostic-derive.rs:509:5
302    |
303 LL |     #[label(typeck::label, foo)]
304    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
305
306 error: `#[label(...)]` is not a valid attribute
307   --> $DIR/diagnostic-derive.rs:517:5
308    |
309 LL |     #[label(typeck::label, foo = "...")]
310    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
311
312 error: `#[label(...)]` is not a valid attribute
313   --> $DIR/diagnostic-derive.rs:525:5
314    |
315 LL |     #[label(typeck::label, foo("..."))]
316    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
317
318 error: `#[primary_span]` is not a valid attribute
319   --> $DIR/diagnostic-derive.rs:538:5
320    |
321 LL |     #[primary_span]
322    |     ^^^^^^^^^^^^^^^
323    |
324    = help: the `primary_span` field attribute is not valid for lint diagnostics
325
326 error: `#[error(...)]` is not a valid attribute
327   --> $DIR/diagnostic-derive.rs:558:1
328    |
329 LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
330    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
331    |
332    = help: `error` and `lint` have been replaced by `diag`
333
334 error: diagnostic slug not specified
335   --> $DIR/diagnostic-derive.rs:558:1
336    |
337 LL | / #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
338 LL | |
339 LL | |
340 LL | |
341 LL | | struct ErrorAttribute {}
342    | |________________________^
343    |
344    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
345
346 error: `#[warn_(...)]` is not a valid attribute
347   --> $DIR/diagnostic-derive.rs:565:1
348    |
349 LL | #[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")]
350    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
351    |
352    = help: `warn_` have been replaced by `warning`
353
354 error: diagnostic slug not specified
355   --> $DIR/diagnostic-derive.rs:565:1
356    |
357 LL | / #[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")]
358 LL | |
359 LL | |
360 LL | |
361 LL | | struct WarnAttribute {}
362    | |_______________________^
363    |
364    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
365
366 error: `#[lint(...)]` is not a valid attribute
367   --> $DIR/diagnostic-derive.rs:572:1
368    |
369 LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
370    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
371    |
372    = help: `error` and `lint` have been replaced by `diag`
373
374 error: diagnostic slug not specified
375   --> $DIR/diagnostic-derive.rs:572:1
376    |
377 LL | / #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
378 LL | |
379 LL | |
380 LL | |
381 LL | | struct LintAttributeOnSessionDiag {}
382    | |____________________________________^
383    |
384    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
385
386 error: `#[lint(...)]` is not a valid attribute
387   --> $DIR/diagnostic-derive.rs:579:1
388    |
389 LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
390    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
391    |
392    = help: `error` and `lint` have been replaced by `diag`
393
394 error: diagnostic slug not specified
395   --> $DIR/diagnostic-derive.rs:579:1
396    |
397 LL | / #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
398 LL | |
399 LL | |
400 LL | |
401 LL | | struct LintAttributeOnLintDiag {}
402    | |_________________________________^
403    |
404    = help: specify the slug as the first argument to the attribute, such as `#[diag(typeck::example_error)]`
405
406 error: cannot find attribute `nonsense` in this scope
407   --> $DIR/diagnostic-derive.rs:53:3
408    |
409 LL | #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")]
410    |   ^^^^^^^^
411
412 error: cannot find attribute `nonsense` in this scope
413   --> $DIR/diagnostic-derive.rs:141:7
414    |
415 LL |     #[nonsense]
416    |       ^^^^^^^^
417
418 error: cannot find attribute `error` in this scope
419   --> $DIR/diagnostic-derive.rs:558:3
420    |
421 LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
422    |   ^^^^^
423
424 error: cannot find attribute `warn_` in this scope
425   --> $DIR/diagnostic-derive.rs:565:3
426    |
427 LL | #[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")]
428    |   ^^^^^ help: a built-in attribute with a similar name exists: `warn`
429
430 error: cannot find attribute `lint` in this scope
431   --> $DIR/diagnostic-derive.rs:572:3
432    |
433 LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
434    |   ^^^^ help: a built-in attribute with a similar name exists: `link`
435
436 error: cannot find attribute `lint` in this scope
437   --> $DIR/diagnostic-derive.rs:579:3
438    |
439 LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
440    |   ^^^^ help: a built-in attribute with a similar name exists: `link`
441
442 error[E0425]: cannot find value `nonsense` in module `rustc_errors::fluent`
443   --> $DIR/diagnostic-derive.rs:66:8
444    |
445 LL | #[diag(nonsense, code = "E0123")]
446    |        ^^^^^^^^ not found in `rustc_errors::fluent`
447
448 error[E0277]: the trait bound `Hello: IntoDiagnosticArg` is not satisfied
449   --> $DIR/diagnostic-derive.rs:331:10
450    |
451 LL | #[derive(SessionDiagnostic)]
452    |          ^^^^^^^^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `Hello`
453    |
454    = help: normalized in stderr
455 note: required by a bound in `DiagnosticBuilder::<'a, G>::set_arg`
456   --> $COMPILER_DIR/rustc_errors/src/diagnostic_builder.rs:LL:CC
457    |
458 LL |         arg: impl IntoDiagnosticArg,
459    |                   ^^^^^^^^^^^^^^^^^ required by this bound in `DiagnosticBuilder::<'a, G>::set_arg`
460    = note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
461
462 error: aborting due to 55 previous errors
463
464 Some errors have detailed explanations: E0277, E0425.
465 For more information about an error, try `rustc --explain E0277`.