]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/attr-stmt-expr-attr-bad.stderr
Merge commit '48d60ab7c505c6c1ebb042eacaafd8dc9f7a9267' into libgccjit-codegen
[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: outer attributes are not allowed on `if` and `else` branches
140   --> $DIR/attr-stmt-expr-attr-bad.rs:41:37
141    |
142 LL | #[cfg(FALSE)] fn e() { let _ = if 0 #[attr] {}; }
143    |                                --   ^^^^^^^ -- the attributes are attached to this branch
144    |                                |    |
145    |                                |    help: remove the attributes
146    |                                the branch belongs to this `if`
147
148 error: an inner attribute is not permitted in this context
149   --> $DIR/attr-stmt-expr-attr-bad.rs:43:38
150    |
151 LL | #[cfg(FALSE)] fn e() { let _ = if 0 {#![attr]}; }
152    |                                      ^^^^^^^^
153    |
154    = 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.
155
156 error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#`
157   --> $DIR/attr-stmt-expr-attr-bad.rs:45:40
158    |
159 LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} #[attr] else {}; }
160    |                                        ^ expected one of `.`, `;`, `?`, `else`, or an operator
161
162 error: outer attributes are not allowed on `if` and `else` branches
163   --> $DIR/attr-stmt-expr-attr-bad.rs:47:45
164    |
165 LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] {}; }
166    |                                        ---- ^^^^^^^ -- the attributes are attached to this branch
167    |                                        |    |
168    |                                        |    help: remove the attributes
169    |                                        the branch belongs to this `else`
170
171 error: an inner attribute is not permitted in this context
172   --> $DIR/attr-stmt-expr-attr-bad.rs:49:46
173    |
174 LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else {#![attr]}; }
175    |                                              ^^^^^^^^
176    |
177    = 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.
178
179 error: outer attributes are not allowed on `if` and `else` branches
180   --> $DIR/attr-stmt-expr-attr-bad.rs:51:45
181    |
182 LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] if 0 {}; }
183    |                                        ---- ^^^^^^^ ------- the attributes are attached to this branch
184    |                                        |    |
185    |                                        |    help: remove the attributes
186    |                                        the branch belongs to this `else`
187
188 error: outer attributes are not allowed on `if` and `else` branches
189   --> $DIR/attr-stmt-expr-attr-bad.rs:53:50
190    |
191 LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; }
192    |                                             --   ^^^^^^^ -- the attributes are attached to this branch
193    |                                             |    |
194    |                                             |    help: remove the attributes
195    |                                             the branch belongs to this `if`
196
197 error: an inner attribute is not permitted in this context
198   --> $DIR/attr-stmt-expr-attr-bad.rs:55:51
199    |
200 LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 {#![attr]}; }
201    |                                                   ^^^^^^^^
202    |
203    = 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.
204
205 error: outer attributes are not allowed on `if` and `else` branches
206   --> $DIR/attr-stmt-expr-attr-bad.rs:57:45
207    |
208 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 #[attr] {}; }
209    |                                --           ^^^^^^^ -- the attributes are attached to this branch
210    |                                |            |
211    |                                |            help: remove the attributes
212    |                                the branch belongs to this `if`
213
214 error: an inner attribute is not permitted in this context
215   --> $DIR/attr-stmt-expr-attr-bad.rs:59:46
216    |
217 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {#![attr]}; }
218    |                                              ^^^^^^^^
219    |
220    = 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.
221
222 error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#`
223   --> $DIR/attr-stmt-expr-attr-bad.rs:61:48
224    |
225 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} #[attr] else {}; }
226    |                                                ^ expected one of `.`, `;`, `?`, `else`, or an operator
227
228 error: outer attributes are not allowed on `if` and `else` branches
229   --> $DIR/attr-stmt-expr-attr-bad.rs:63:53
230    |
231 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] {}; }
232    |                                                ---- ^^^^^^^ -- the attributes are attached to this branch
233    |                                                |    |
234    |                                                |    help: remove the attributes
235    |                                                the branch belongs to this `else`
236
237 error: an inner attribute is not permitted in this context
238   --> $DIR/attr-stmt-expr-attr-bad.rs:65:54
239    |
240 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else {#![attr]}; }
241    |                                                      ^^^^^^^^
242    |
243    = 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.
244
245 error: outer attributes are not allowed on `if` and `else` branches
246   --> $DIR/attr-stmt-expr-attr-bad.rs:67:53
247    |
248 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] if let _ = 0 {}; }
249    |                                                ---- ^^^^^^^ --------------- the attributes are attached to this branch
250    |                                                |    |
251    |                                                |    help: remove the attributes
252    |                                                the branch belongs to this `else`
253
254 error: outer attributes are not allowed on `if` and `else` branches
255   --> $DIR/attr-stmt-expr-attr-bad.rs:69:66
256    |
257 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 #[attr] {}; }
258    |                                                     --           ^^^^^^^ -- the attributes are attached to this branch
259    |                                                     |            |
260    |                                                     |            help: remove the attributes
261    |                                                     the branch belongs to this `if`
262
263 error: an inner attribute is not permitted in this context
264   --> $DIR/attr-stmt-expr-attr-bad.rs:71:67
265    |
266 LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {#![attr]}; }
267    |                                                                   ^^^^^^^^
268    |
269    = 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.
270
271 error: an inner attribute is not permitted following an outer attribute
272   --> $DIR/attr-stmt-expr-attr-bad.rs:74:32
273    |
274 LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] let _ = 0; }
275    |                        ------- ^^^^^^^^ not permitted following an outer attribute
276    |                        |
277    |                        previous outer attribute
278    |
279    = 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.
280
281 error: an inner attribute is not permitted following an outer attribute
282   --> $DIR/attr-stmt-expr-attr-bad.rs:76:32
283    |
284 LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] 0; }
285    |                        ------- ^^^^^^^^ not permitted following an outer attribute
286    |                        |
287    |                        previous outer attribute
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:78:32
293    |
294 LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] foo!(); }
295    |                        ------- ^^^^^^^^ not permitted following an outer attribute
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:80:32
303    |
304 LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] foo![]; }
305    |                        ------- ^^^^^^^^ not permitted following an outer attribute
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:82:32
313    |
314 LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] foo!{}; }
315    |                        ------- ^^^^^^^^ not permitted following an outer attribute
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[E0586]: inclusive range with no end
322   --> $DIR/attr-stmt-expr-attr-bad.rs:88:35
323    |
324 LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } }
325    |                                   ^^^ help: use `..` instead
326    |
327    = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
328
329 error: expected one of `=>`, `if`, or `|`, found `#`
330   --> $DIR/attr-stmt-expr-attr-bad.rs:88:38
331    |
332 LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } }
333    |                                      ^ expected one of `=>`, `if`, or `|`
334
335 error[E0586]: inclusive range with no end
336   --> $DIR/attr-stmt-expr-attr-bad.rs:91:35
337    |
338 LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
339    |                                   ^^^ help: use `..` instead
340    |
341    = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
342
343 error: expected one of `=>`, `if`, or `|`, found `#`
344   --> $DIR/attr-stmt-expr-attr-bad.rs:91:38
345    |
346 LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
347    |                                      ^ expected one of `=>`, `if`, or `|`
348
349 error: unexpected token: `#`
350   --> $DIR/attr-stmt-expr-attr-bad.rs:94:39
351    |
352 LL | #[cfg(FALSE)] fn e() { match 0 { 0..=-#[attr] 10 => () } }
353    |                                       ^
354
355 error[E0586]: inclusive range with no end
356   --> $DIR/attr-stmt-expr-attr-bad.rs:96:35
357    |
358 LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } }
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:96:38
365    |
366 LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } }
367    |                                      ^ expected one of `=>`, `if`, or `|`
368
369 error: unexpected token: `#`
370   --> $DIR/attr-stmt-expr-attr-bad.rs:100:34
371    |
372 LL | #[cfg(FALSE)] fn e() { let _ = x.#![attr]foo(); }
373    |                                  ^
374
375 error: expected one of `.`, `;`, `?`, or an operator, found `#`
376   --> $DIR/attr-stmt-expr-attr-bad.rs:100:34
377    |
378 LL | #[cfg(FALSE)] fn e() { let _ = x.#![attr]foo(); }
379    |                                  ^ expected one of `.`, `;`, `?`, or an operator
380
381 error: unexpected token: `#`
382   --> $DIR/attr-stmt-expr-attr-bad.rs:103:34
383    |
384 LL | #[cfg(FALSE)] fn e() { let _ = x.#[attr]foo(); }
385    |                                  ^
386
387 error: expected one of `.`, `;`, `?`, or an operator, found `#`
388   --> $DIR/attr-stmt-expr-attr-bad.rs:103:34
389    |
390 LL | #[cfg(FALSE)] fn e() { let _ = x.#[attr]foo(); }
391    |                                  ^ expected one of `.`, `;`, `?`, or an operator
392
393 error: expected statement after outer attribute
394   --> $DIR/attr-stmt-expr-attr-bad.rs:108:37
395    |
396 LL | #[cfg(FALSE)] fn e() { { fn foo() { #[attr]; } } }
397    |                                     ^^^^^^^
398
399 error: expected statement after outer attribute
400   --> $DIR/attr-stmt-expr-attr-bad.rs:110:37
401    |
402 LL | #[cfg(FALSE)] fn e() { { fn foo() { #[attr] } } }
403    |                                     ^^^^^^^
404
405 error: aborting due to 53 previous errors
406
407 For more information about this error, try `rustc --explain E0586`.