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