]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/attr-stmt-expr-attr-bad.stderr
Merge commit '7c21f91b15b7604f818565646b686d90f99d1baf' into clippyup
[rust.git] / src / test / ui / parser / attr-stmt-expr-attr-bad.stderr
1 error: an inner attribute is not permitted in this context
2   --> $DIR/attr-stmt-expr-attr-bad.rs:5:36
3    |
4 LL | #[cfg(FALSE)] fn e() { let _ = box #![attr] 0; }
5    |                                    ^^^^^^^^
6    |
7    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
8    = note: outer attributes, like `#[test]`, annotate the item following them
9
10 error: expected expression, found `]`
11   --> $DIR/attr-stmt-expr-attr-bad.rs:7:40
12    |
13 LL | #[cfg(FALSE)] fn e() { let _ = [#[attr]]; }
14    |                                        ^ expected expression
15
16 error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `#`
17   --> $DIR/attr-stmt-expr-attr-bad.rs:9:35
18    |
19 LL | #[cfg(FALSE)] fn e() { let _ = foo#[attr](); }
20    |                                   ^ expected one of 8 possible tokens
21
22 error: an inner attribute is not permitted in this context
23   --> $DIR/attr-stmt-expr-attr-bad.rs:11:36
24    |
25 LL | #[cfg(FALSE)] fn e() { let _ = foo(#![attr]); }
26    |                                    ^^^^^^^^
27    |
28    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
29    = note: outer attributes, like `#[test]`, annotate the item following them
30
31 error: expected expression, found `)`
32   --> $DIR/attr-stmt-expr-attr-bad.rs:11:44
33    |
34 LL | #[cfg(FALSE)] fn e() { let _ = foo(#![attr]); }
35    |                                            ^ expected expression
36
37 error: an inner attribute is not permitted in this context
38   --> $DIR/attr-stmt-expr-attr-bad.rs:14:38
39    |
40 LL | #[cfg(FALSE)] fn e() { let _ = x.foo(#![attr]); }
41    |                                      ^^^^^^^^
42    |
43    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
44    = note: outer attributes, like `#[test]`, annotate the item following them
45
46 error: expected expression, found `)`
47   --> $DIR/attr-stmt-expr-attr-bad.rs:14:46
48    |
49 LL | #[cfg(FALSE)] fn e() { let _ = x.foo(#![attr]); }
50    |                                              ^ expected expression
51
52 error: an inner attribute is not permitted in this context
53   --> $DIR/attr-stmt-expr-attr-bad.rs:17:36
54    |
55 LL | #[cfg(FALSE)] fn e() { let _ = 0 + #![attr] 0; }
56    |                                    ^^^^^^^^
57    |
58    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
59    = note: outer attributes, like `#[test]`, annotate the item following them
60
61 error: an inner attribute is not permitted in this context
62   --> $DIR/attr-stmt-expr-attr-bad.rs:19:33
63    |
64 LL | #[cfg(FALSE)] fn e() { let _ = !#![attr] 0; }
65    |                                 ^^^^^^^^
66    |
67    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
68    = note: outer attributes, like `#[test]`, annotate the item following them
69
70 error: an inner attribute is not permitted in this context
71   --> $DIR/attr-stmt-expr-attr-bad.rs:21:33
72    |
73 LL | #[cfg(FALSE)] fn e() { let _ = -#![attr] 0; }
74    |                                 ^^^^^^^^
75    |
76    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
77    = note: outer attributes, like `#[test]`, annotate the item following them
78
79 error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `#`
80   --> $DIR/attr-stmt-expr-attr-bad.rs:23:34
81    |
82 LL | #[cfg(FALSE)] fn e() { let _ = x #![attr] as Y; }
83    |                                  ^ expected one of 8 possible tokens
84
85 error: an inner attribute is not permitted in this context
86   --> $DIR/attr-stmt-expr-attr-bad.rs:25:35
87    |
88 LL | #[cfg(FALSE)] fn e() { let _ = || #![attr] foo; }
89    |                                   ^^^^^^^^
90    |
91    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
92    = note: outer attributes, like `#[test]`, annotate the item following them
93
94 error: an inner attribute is not permitted in this context
95   --> $DIR/attr-stmt-expr-attr-bad.rs:27:40
96    |
97 LL | #[cfg(FALSE)] fn e() { let _ = move || #![attr] foo; }
98    |                                        ^^^^^^^^
99    |
100    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
101    = note: outer attributes, like `#[test]`, annotate the item following them
102
103 error: an inner attribute is not permitted in this context
104   --> $DIR/attr-stmt-expr-attr-bad.rs:29:35
105    |
106 LL | #[cfg(FALSE)] fn e() { let _ = || #![attr] {foo}; }
107    |                                   ^^^^^^^^
108    |
109    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
110    = note: outer attributes, like `#[test]`, annotate the item following them
111
112 error: an inner attribute is not permitted in this context
113   --> $DIR/attr-stmt-expr-attr-bad.rs:31:40
114    |
115 LL | #[cfg(FALSE)] fn e() { let _ = move || #![attr] {foo}; }
116    |                                        ^^^^^^^^
117    |
118    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
119    = note: outer attributes, like `#[test]`, annotate the item following them
120
121 error: expected expression, found `..`
122   --> $DIR/attr-stmt-expr-attr-bad.rs:33:40
123    |
124 LL | #[cfg(FALSE)] fn e() { let _ = #[attr] ..#[attr] 0; }
125    |                                        ^^ expected expression
126
127 error: expected expression, found `..`
128   --> $DIR/attr-stmt-expr-attr-bad.rs:35:40
129    |
130 LL | #[cfg(FALSE)] fn e() { let _ = #[attr] ..; }
131    |                                        ^^ expected expression
132
133 error: an inner attribute is not permitted in this context
134   --> $DIR/attr-stmt-expr-attr-bad.rs:37:41
135    |
136 LL | #[cfg(FALSE)] fn e() { let _ = #[attr] &#![attr] 0; }
137    |                                         ^^^^^^^^
138    |
139    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
140    = note: outer attributes, like `#[test]`, annotate the item following them
141
142 error: an inner attribute is not permitted in this context
143   --> $DIR/attr-stmt-expr-attr-bad.rs:39:45
144    |
145 LL | #[cfg(FALSE)] fn e() { let _ = #[attr] &mut #![attr] 0; }
146    |                                             ^^^^^^^^
147    |
148    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
149    = note: outer attributes, like `#[test]`, annotate the item following them
150
151 error: outer attributes are not allowed on `if` and `else` branches
152   --> $DIR/attr-stmt-expr-attr-bad.rs:41:37
153    |
154 LL | #[cfg(FALSE)] fn e() { let _ = if 0 #[attr] {}; }
155    |                                --   ^^^^^^^ -- the attributes are attached to this branch
156    |                                |    |
157    |                                |    help: remove the attributes
158    |                                the branch belongs to this `if`
159
160 error: an inner attribute is not permitted in this context
161   --> $DIR/attr-stmt-expr-attr-bad.rs:43:38
162    |
163 LL | #[cfg(FALSE)] fn e() { let _ = if 0 {#![attr]}; }
164    |                                      ^^^^^^^^
165    |
166    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
167    = note: outer attributes, like `#[test]`, annotate the item following them
168
169 error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#`
170   --> $DIR/attr-stmt-expr-attr-bad.rs:45:40
171    |
172 LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} #[attr] else {}; }
173    |                                        ^ expected one of `.`, `;`, `?`, `else`, or an operator
174
175 error: outer attributes are not allowed on `if` and `else` branches
176   --> $DIR/attr-stmt-expr-attr-bad.rs:47:45
177    |
178 LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] {}; }
179    |                                        ---- ^^^^^^^ -- the attributes are attached to this branch
180    |                                        |    |
181    |                                        |    help: remove the attributes
182    |                                        the branch belongs to this `else`
183
184 error: an inner attribute is not permitted in this context
185   --> $DIR/attr-stmt-expr-attr-bad.rs:49:46
186    |
187 LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else {#![attr]}; }
188    |                                              ^^^^^^^^
189    |
190    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
191    = note: outer attributes, like `#[test]`, annotate the item following them
192
193 error: outer attributes are not allowed on `if` and `else` branches
194   --> $DIR/attr-stmt-expr-attr-bad.rs:51:45
195    |
196 LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] if 0 {}; }
197    |                                        ---- ^^^^^^^ ------- the attributes are attached to this branch
198    |                                        |    |
199    |                                        |    help: remove the attributes
200    |                                        the branch belongs to this `else`
201
202 error: outer attributes are not allowed on `if` and `else` branches
203   --> $DIR/attr-stmt-expr-attr-bad.rs:53:50
204    |
205 LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; }
206    |                                             --   ^^^^^^^ -- the attributes are attached to this branch
207    |                                             |    |
208    |                                             |    help: remove the attributes
209    |                                             the branch belongs to this `if`
210
211 error: an inner attribute is not permitted in this context
212   --> $DIR/attr-stmt-expr-attr-bad.rs:55:51
213    |
214 LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 {#![attr]}; }
215    |                                                   ^^^^^^^^
216    |
217    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
218    = note: outer attributes, like `#[test]`, annotate the item following them
219
220 error: outer attributes are not allowed on `if` and `else` branches
221   --> $DIR/attr-stmt-expr-attr-bad.rs:57:45
222    |
223 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 #[attr] {}; }
224    |                                --           ^^^^^^^ -- the attributes are attached to this branch
225    |                                |            |
226    |                                |            help: remove the attributes
227    |                                the branch belongs to this `if`
228
229 error: an inner attribute is not permitted in this context
230   --> $DIR/attr-stmt-expr-attr-bad.rs:59:46
231    |
232 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {#![attr]}; }
233    |                                              ^^^^^^^^
234    |
235    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
236    = note: outer attributes, like `#[test]`, annotate the item following them
237
238 error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#`
239   --> $DIR/attr-stmt-expr-attr-bad.rs:61:48
240    |
241 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} #[attr] else {}; }
242    |                                                ^ expected one of `.`, `;`, `?`, `else`, or an operator
243
244 error: outer attributes are not allowed on `if` and `else` branches
245   --> $DIR/attr-stmt-expr-attr-bad.rs:63:53
246    |
247 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] {}; }
248    |                                                ---- ^^^^^^^ -- the attributes are attached to this branch
249    |                                                |    |
250    |                                                |    help: remove the attributes
251    |                                                the branch belongs to this `else`
252
253 error: an inner attribute is not permitted in this context
254   --> $DIR/attr-stmt-expr-attr-bad.rs:65:54
255    |
256 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else {#![attr]}; }
257    |                                                      ^^^^^^^^
258    |
259    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
260    = note: outer attributes, like `#[test]`, annotate the item following them
261
262 error: outer attributes are not allowed on `if` and `else` branches
263   --> $DIR/attr-stmt-expr-attr-bad.rs:67:53
264    |
265 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] if let _ = 0 {}; }
266    |                                                ---- ^^^^^^^ --------------- the attributes are attached to this branch
267    |                                                |    |
268    |                                                |    help: remove the attributes
269    |                                                the branch belongs to this `else`
270
271 error: outer attributes are not allowed on `if` and `else` branches
272   --> $DIR/attr-stmt-expr-attr-bad.rs:69:66
273    |
274 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 #[attr] {}; }
275    |                                                     --           ^^^^^^^ -- the attributes are attached to this branch
276    |                                                     |            |
277    |                                                     |            help: remove the attributes
278    |                                                     the branch belongs to this `if`
279
280 error: an inner attribute is not permitted in this context
281   --> $DIR/attr-stmt-expr-attr-bad.rs:71:67
282    |
283 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {#![attr]}; }
284    |                                                                   ^^^^^^^^
285    |
286    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
287    = note: outer attributes, like `#[test]`, annotate the item following them
288
289 error: an inner attribute is not permitted following an outer attribute
290   --> $DIR/attr-stmt-expr-attr-bad.rs:74:32
291    |
292 LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] let _ = 0; }
293    |                        ------- ^^^^^^^^ not permitted following an outer attribute
294    |                        |
295    |                        previous outer attribute
296    |
297    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
298    = note: outer attributes, like `#[test]`, annotate the item following them
299
300 error: an inner attribute is not permitted following an outer attribute
301   --> $DIR/attr-stmt-expr-attr-bad.rs:76:32
302    |
303 LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] 0; }
304    |                        ------- ^^^^^^^^ not permitted following an outer attribute
305    |                        |
306    |                        previous outer attribute
307    |
308    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
309    = note: outer attributes, like `#[test]`, annotate the item following them
310
311 error: an inner attribute is not permitted following an outer attribute
312   --> $DIR/attr-stmt-expr-attr-bad.rs:78:32
313    |
314 LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] foo!(); }
315    |                        ------- ^^^^^^^^ ------- the inner attribute doesn't annotate this item macro invocation
316    |                        |       |
317    |                        |       not permitted following an outer attribute
318    |                        previous outer attribute
319    |
320    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
321 help: to annotate the item macro invocation, change the attribute from inner to outer style
322    |
323 LL - #[cfg(FALSE)] fn s() { #[attr] #![attr] foo!(); }
324 LL + #[cfg(FALSE)] fn s() { #[attr] #[attr] foo!(); }
325    | 
326
327 error: an inner attribute is not permitted following an outer attribute
328   --> $DIR/attr-stmt-expr-attr-bad.rs:80:32
329    |
330 LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] foo![]; }
331    |                        ------- ^^^^^^^^ ------- the inner attribute doesn't annotate this item macro invocation
332    |                        |       |
333    |                        |       not permitted following an outer attribute
334    |                        previous outer attribute
335    |
336    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
337 help: to annotate the item macro invocation, change the attribute from inner to outer style
338    |
339 LL - #[cfg(FALSE)] fn s() { #[attr] #![attr] foo![]; }
340 LL + #[cfg(FALSE)] fn s() { #[attr] #[attr] foo![]; }
341    | 
342
343 error: an inner attribute is not permitted following an outer attribute
344   --> $DIR/attr-stmt-expr-attr-bad.rs:82:32
345    |
346 LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] foo!{}; }
347    |                        ------- ^^^^^^^^ ------ the inner attribute doesn't annotate this item macro invocation
348    |                        |       |
349    |                        |       not permitted following an outer attribute
350    |                        previous outer attribute
351    |
352    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
353 help: to annotate the item macro invocation, change the attribute from inner to outer style
354    |
355 LL - #[cfg(FALSE)] fn s() { #[attr] #![attr] foo!{}; }
356 LL + #[cfg(FALSE)] fn s() { #[attr] #[attr] foo!{}; }
357    | 
358
359 error[E0586]: inclusive range with no end
360   --> $DIR/attr-stmt-expr-attr-bad.rs:88:35
361    |
362 LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } }
363    |                                   ^^^ help: use `..` instead
364    |
365    = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
366
367 error: expected one of `=>`, `if`, or `|`, found `#`
368   --> $DIR/attr-stmt-expr-attr-bad.rs:88:38
369    |
370 LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } }
371    |                                      ^ expected one of `=>`, `if`, or `|`
372
373 error[E0586]: inclusive range with no end
374   --> $DIR/attr-stmt-expr-attr-bad.rs:91:35
375    |
376 LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
377    |                                   ^^^ help: use `..` instead
378    |
379    = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
380
381 error: expected one of `=>`, `if`, or `|`, found `#`
382   --> $DIR/attr-stmt-expr-attr-bad.rs:91:38
383    |
384 LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
385    |                                      ^ expected one of `=>`, `if`, or `|`
386
387 error: unexpected token: `#`
388   --> $DIR/attr-stmt-expr-attr-bad.rs:94:39
389    |
390 LL | #[cfg(FALSE)] fn e() { match 0 { 0..=-#[attr] 10 => () } }
391    |                                       ^
392
393 error[E0586]: inclusive range with no end
394   --> $DIR/attr-stmt-expr-attr-bad.rs:96:35
395    |
396 LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } }
397    |                                   ^^^ help: use `..` instead
398    |
399    = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
400
401 error: expected one of `=>`, `if`, or `|`, found `#`
402   --> $DIR/attr-stmt-expr-attr-bad.rs:96:38
403    |
404 LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } }
405    |                                      ^ expected one of `=>`, `if`, or `|`
406
407 error: unexpected token: `#`
408   --> $DIR/attr-stmt-expr-attr-bad.rs:100:34
409    |
410 LL | #[cfg(FALSE)] fn e() { let _ = x.#![attr]foo(); }
411    |                                  ^
412
413 error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#`
414   --> $DIR/attr-stmt-expr-attr-bad.rs:100:34
415    |
416 LL | #[cfg(FALSE)] fn e() { let _ = x.#![attr]foo(); }
417    |                                  ^ expected one of `.`, `;`, `?`, `else`, or an operator
418
419 error: unexpected token: `#`
420   --> $DIR/attr-stmt-expr-attr-bad.rs:103:34
421    |
422 LL | #[cfg(FALSE)] fn e() { let _ = x.#[attr]foo(); }
423    |                                  ^
424
425 error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#`
426   --> $DIR/attr-stmt-expr-attr-bad.rs:103:34
427    |
428 LL | #[cfg(FALSE)] fn e() { let _ = x.#[attr]foo(); }
429    |                                  ^ expected one of `.`, `;`, `?`, `else`, or an operator
430
431 error: expected statement after outer attribute
432   --> $DIR/attr-stmt-expr-attr-bad.rs:108:37
433    |
434 LL | #[cfg(FALSE)] fn e() { { fn foo() { #[attr]; } } }
435    |                                     ^^^^^^^
436
437 error: expected statement after outer attribute
438   --> $DIR/attr-stmt-expr-attr-bad.rs:110:37
439    |
440 LL | #[cfg(FALSE)] fn e() { { fn foo() { #[attr] } } }
441    |                                     ^^^^^^^
442
443 error: aborting due to 53 previous errors
444
445 For more information about this error, try `rustc --explain E0586`.