]> git.proxmox.com Git - rustc.git/blob - src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
New upstream version 1.62.1+dfsg1
[rustc.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:37:1
3 |
4 LL | / #[error(code = "E0123", slug = "foo")]
5 LL | |
6 LL | | enum SessionDiagnosticOnEnum {
7 LL | | Foo,
8 LL | | Bar,
9 LL | | }
10 | |_^
11
12 error: `#[error = ...]` is not a valid attribute
13 --> $DIR/diagnostic-derive.rs:46:1
14 |
15 LL | #[error = "E0123"]
16 | ^^^^^^^^^^^^^^^^^^
17
18 error: `#[nonsense(...)]` is not a valid attribute
19 --> $DIR/diagnostic-derive.rs:51:1
20 |
21 LL | #[nonsense(code = "E0123", slug = "foo")]
22 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23 |
24 = help: only `error` and `warning` are valid attributes
25
26 error: diagnostic kind not specified
27 --> $DIR/diagnostic-derive.rs:51:1
28 |
29 LL | / #[nonsense(code = "E0123", slug = "foo")]
30 LL | |
31 LL | |
32 LL | |
33 LL | | struct InvalidStructAttr {}
34 | |___________________________^
35 |
36 = help: use the `#[error(...)]` attribute to create an error
37
38 error: `#[error("...")]` is not a valid attribute
39 --> $DIR/diagnostic-derive.rs:58:9
40 |
41 LL | #[error("E0123")]
42 | ^^^^^^^
43
44 error: `slug` not specified
45 --> $DIR/diagnostic-derive.rs:58:1
46 |
47 LL | / #[error("E0123")]
48 LL | |
49 LL | |
50 LL | | struct InvalidLitNestedAttr {}
51 | |______________________________^
52 |
53 = help: use the `#[error(slug = "...")]` attribute to set this diagnostic's slug
54
55 error: `#[error(nonsense)]` is not a valid attribute
56 --> $DIR/diagnostic-derive.rs:64:9
57 |
58 LL | #[error(nonsense, code = "E0123", slug = "foo")]
59 | ^^^^^^^^
60
61 error: `#[error(nonsense(...))]` is not a valid attribute
62 --> $DIR/diagnostic-derive.rs:69:9
63 |
64 LL | #[error(nonsense("foo"), code = "E0123", slug = "foo")]
65 | ^^^^^^^^^^^^^^^
66
67 error: `#[error(nonsense = ...)]` is not a valid attribute
68 --> $DIR/diagnostic-derive.rs:74:9
69 |
70 LL | #[error(nonsense = "...", code = "E0123", slug = "foo")]
71 | ^^^^^^^^^^^^^^^^
72 |
73 = help: only `slug` and `code` are valid nested attributes
74
75 error: `#[error(nonsense = ...)]` is not a valid attribute
76 --> $DIR/diagnostic-derive.rs:79:9
77 |
78 LL | #[error(nonsense = 4, code = "E0123", slug = "foo")]
79 | ^^^^^^^^^^^^
80
81 error: `#[suggestion = ...]` is not a valid attribute
82 --> $DIR/diagnostic-derive.rs:86:5
83 |
84 LL | #[suggestion = "bar"]
85 | ^^^^^^^^^^^^^^^^^^^^^
86 |
87 = help: only `label`, `note` and `help` are valid field attributes
88
89 error: specified multiple times
90 --> $DIR/diagnostic-derive.rs:93:1
91 |
92 LL | #[error(code = "E0456", slug = "bar")]
93 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94 |
95 note: previously specified here
96 --> $DIR/diagnostic-derive.rs:92:1
97 |
98 LL | #[error(code = "E0123", slug = "foo")]
99 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100
101 error: specified multiple times
102 --> $DIR/diagnostic-derive.rs:93:16
103 |
104 LL | #[error(code = "E0456", slug = "bar")]
105 | ^^^^^^^
106 |
107 note: previously specified here
108 --> $DIR/diagnostic-derive.rs:92:16
109 |
110 LL | #[error(code = "E0123", slug = "foo")]
111 | ^^^^^^^
112
113 error: specified multiple times
114 --> $DIR/diagnostic-derive.rs:93:32
115 |
116 LL | #[error(code = "E0456", slug = "bar")]
117 | ^^^^^
118 |
119 note: previously specified here
120 --> $DIR/diagnostic-derive.rs:92:32
121 |
122 LL | #[error(code = "E0123", slug = "foo")]
123 | ^^^^^
124
125 error: specified multiple times
126 --> $DIR/diagnostic-derive.rs:101:1
127 |
128 LL | #[warning(code = "E0293", slug = "bar")]
129 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130 |
131 note: previously specified here
132 --> $DIR/diagnostic-derive.rs:100:1
133 |
134 LL | #[error(code = "E0123", slug = "foo")]
135 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136
137 error: specified multiple times
138 --> $DIR/diagnostic-derive.rs:101:18
139 |
140 LL | #[warning(code = "E0293", slug = "bar")]
141 | ^^^^^^^
142 |
143 note: previously specified here
144 --> $DIR/diagnostic-derive.rs:100:16
145 |
146 LL | #[error(code = "E0123", slug = "foo")]
147 | ^^^^^^^
148
149 error: specified multiple times
150 --> $DIR/diagnostic-derive.rs:101:34
151 |
152 LL | #[warning(code = "E0293", slug = "bar")]
153 | ^^^^^
154 |
155 note: previously specified here
156 --> $DIR/diagnostic-derive.rs:100:32
157 |
158 LL | #[error(code = "E0123", slug = "foo")]
159 | ^^^^^
160
161 error: specified multiple times
162 --> $DIR/diagnostic-derive.rs:108:32
163 |
164 LL | #[error(code = "E0456", code = "E0457", slug = "bar")]
165 | ^^^^^^^
166 |
167 note: previously specified here
168 --> $DIR/diagnostic-derive.rs:108:16
169 |
170 LL | #[error(code = "E0456", code = "E0457", slug = "bar")]
171 | ^^^^^^^
172
173 error: specified multiple times
174 --> $DIR/diagnostic-derive.rs:113:46
175 |
176 LL | #[error(code = "E0456", slug = "foo", slug = "bar")]
177 | ^^^^^
178 |
179 note: previously specified here
180 --> $DIR/diagnostic-derive.rs:113:32
181 |
182 LL | #[error(code = "E0456", slug = "foo", slug = "bar")]
183 | ^^^^^
184
185 error: diagnostic kind not specified
186 --> $DIR/diagnostic-derive.rs:118:1
187 |
188 LL | struct KindNotProvided {}
189 | ^^^^^^^^^^^^^^^^^^^^^^^^^
190 |
191 = help: use the `#[error(...)]` attribute to create an error
192
193 error: `slug` not specified
194 --> $DIR/diagnostic-derive.rs:121:1
195 |
196 LL | / #[error(code = "E0456")]
197 LL | | struct SlugNotProvided {}
198 | |_________________________^
199 |
200 = help: use the `#[error(slug = "...")]` attribute to set this diagnostic's slug
201
202 error: the `#[primary_span]` attribute can only be applied to fields of type `Span`
203 --> $DIR/diagnostic-derive.rs:131:5
204 |
205 LL | #[primary_span]
206 | ^^^^^^^^^^^^^^^
207
208 error: `#[nonsense]` is not a valid attribute
209 --> $DIR/diagnostic-derive.rs:139:5
210 |
211 LL | #[nonsense]
212 | ^^^^^^^^^^^
213 |
214 = help: only `skip_arg`, `primary_span`, `label`, `note`, `help` and `subdiagnostic` are valid field attributes
215
216 error: the `#[label = ...]` attribute can only be applied to fields of type `Span`
217 --> $DIR/diagnostic-derive.rs:156:5
218 |
219 LL | #[label = "bar"]
220 | ^^^^^^^^^^^^^^^^
221
222 error: `name` doesn't refer to a field on this type
223 --> $DIR/diagnostic-derive.rs:164:42
224 |
225 LL | #[suggestion(message = "bar", code = "{name}")]
226 | ^^^^^^^^
227
228 error: invalid format string: expected `'}'` but string was terminated
229 --> $DIR/diagnostic-derive.rs:169:16
230 |
231 LL | #[derive(SessionDiagnostic)]
232 | - ^ expected `'}'` in format string
233 | |
234 | because of this opening brace
235 |
236 = note: if you intended to print `{`, you can escape it using `{{`
237 = note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
238
239 error: invalid format string: unmatched `}` found
240 --> $DIR/diagnostic-derive.rs:179:15
241 |
242 LL | #[derive(SessionDiagnostic)]
243 | ^ unmatched `}` in format string
244 |
245 = note: if you intended to print `}`, you can escape it using `}}`
246 = note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
247
248 error: the `#[label = ...]` attribute can only be applied to fields of type `Span`
249 --> $DIR/diagnostic-derive.rs:199:5
250 |
251 LL | #[label = "bar"]
252 | ^^^^^^^^^^^^^^^^
253
254 error: `#[suggestion(nonsense = ...)]` is not a valid attribute
255 --> $DIR/diagnostic-derive.rs:224:18
256 |
257 LL | #[suggestion(nonsense = "bar")]
258 | ^^^^^^^^^^^^^^^^
259 |
260 = help: only `message`, `code` and `applicability` are valid field attributes
261
262 error: `#[suggestion(msg = ...)]` is not a valid attribute
263 --> $DIR/diagnostic-derive.rs:232:18
264 |
265 LL | #[suggestion(msg = "bar")]
266 | ^^^^^^^^^^^
267 |
268 = help: only `message`, `code` and `applicability` are valid field attributes
269
270 error: wrong field type for suggestion
271 --> $DIR/diagnostic-derive.rs:254:5
272 |
273 LL | / #[suggestion(message = "bar", code = "This is suggested code")]
274 LL | |
275 LL | | suggestion: Applicability,
276 | |_____________________________^
277 |
278 = help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`
279
280 error: type of field annotated with `#[suggestion(...)]` contains more than one `Span`
281 --> $DIR/diagnostic-derive.rs:269:5
282 |
283 LL | / #[suggestion(message = "bar", code = "This is suggested code")]
284 LL | |
285 LL | | suggestion: (Span, Span, Applicability),
286 | |___________________________________________^
287
288 error: type of field annotated with `#[suggestion(...)]` contains more than one Applicability
289 --> $DIR/diagnostic-derive.rs:277:5
290 |
291 LL | / #[suggestion(message = "bar", code = "This is suggested code")]
292 LL | |
293 LL | | suggestion: (Applicability, Applicability, Span),
294 | |____________________________________________________^
295
296 error: `#[label(...)]` is not a valid attribute
297 --> $DIR/diagnostic-derive.rs:285:5
298 |
299 LL | #[label("bar")]
300 | ^^^^^^^^^^^^^^^
301 |
302 = help: only `suggestion{,_short,_hidden,_verbose}` are valid field attributes
303
304 error: `#[help]` must come after `#[error(..)]` or `#[warn(..)]`
305 --> $DIR/diagnostic-derive.rs:406:1
306 |
307 LL | #[help]
308 | ^^^^^^^
309
310 error: `#[help = ...]` must come after `#[error(..)]` or `#[warn(..)]`
311 --> $DIR/diagnostic-derive.rs:414:1
312 |
313 LL | #[help = "bar"]
314 | ^^^^^^^^^^^^^^^
315
316 error: `#[note]` must come after `#[error(..)]` or `#[warn(..)]`
317 --> $DIR/diagnostic-derive.rs:422:1
318 |
319 LL | #[note]
320 | ^^^^^^^
321
322 error: `#[note = ...]` must come after `#[error(..)]` or `#[warn(..)]`
323 --> $DIR/diagnostic-derive.rs:430:1
324 |
325 LL | #[note = "bar"]
326 | ^^^^^^^^^^^^^^^
327
328 error: applicability cannot be set in both the field and attribute
329 --> $DIR/diagnostic-derive.rs:440:49
330 |
331 LL | #[suggestion(message = "bar", code = "...", applicability = "maybe-incorrect")]
332 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
333
334 error: invalid applicability
335 --> $DIR/diagnostic-derive.rs:448:49
336 |
337 LL | #[suggestion(message = "bar", code = "...", applicability = "batman")]
338 | ^^^^^^^^^^^^^^^^^^^^^^^^
339
340 error: cannot find attribute `nonsense` in this scope
341 --> $DIR/diagnostic-derive.rs:51:3
342 |
343 LL | #[nonsense(code = "E0123", slug = "foo")]
344 | ^^^^^^^^
345
346 error: cannot find attribute `nonsense` in this scope
347 --> $DIR/diagnostic-derive.rs:139:7
348 |
349 LL | #[nonsense]
350 | ^^^^^^^^
351
352 error[E0277]: the trait bound `Hello: IntoDiagnosticArg` is not satisfied
353 --> $DIR/diagnostic-derive.rs:329:10
354 |
355 LL | #[derive(SessionDiagnostic)]
356 | ^^^^^^^^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `Hello`
357 |
358 = help: the following other types implement trait `IntoDiagnosticArg`:
359 &'a str
360 Ident
361 String
362 Symbol
363 rustc_middle::ty::Ty<'tcx>
364 usize
365 note: required by a bound in `DiagnosticBuilder::<'a, G>::set_arg`
366 --> $COMPILER_DIR/rustc_errors/src/diagnostic_builder.rs:531:19
367 |
368 LL | arg: impl IntoDiagnosticArg,
369 | ^^^^^^^^^^^^^^^^^ required by this bound in `DiagnosticBuilder::<'a, G>::set_arg`
370 = note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
371
372 error: aborting due to 43 previous errors
373
374 For more information about this error, try `rustc --explain E0277`.