fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

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