]>
Commit | Line | Data |
---|---|---|
dc9dc135 | 1 | error[E0728]: `await` is only allowed inside `async` functions and blocks |
a2a8927a | 2 | --> $DIR/issue-62009-1.rs:6:22 |
dc9dc135 XL |
3 | | |
4 | LL | fn main() { | |
5 | | ---- this is not `async` | |
6 | LL | async { let (); }.await; | |
a2a8927a | 7 | | ^^^^^^ only allowed inside `async` functions and blocks |
dc9dc135 XL |
8 | |
9 | error[E0728]: `await` is only allowed inside `async` functions and blocks | |
a2a8927a | 10 | --> $DIR/issue-62009-1.rs:10:6 |
dc9dc135 | 11 | | |
a2a8927a XL |
12 | LL | fn main() { |
13 | | ---- this is not `async` | |
dc9dc135 | 14 | ... |
a2a8927a XL |
15 | LL | }.await; |
16 | | ^^^^^^ only allowed inside `async` functions and blocks | |
dc9dc135 XL |
17 | |
18 | error[E0728]: `await` is only allowed inside `async` functions and blocks | |
a2a8927a | 19 | --> $DIR/issue-62009-1.rs:12:15 |
dc9dc135 XL |
20 | | |
21 | LL | fn main() { | |
22 | | ---- this is not `async` | |
23 | ... | |
24 | LL | (|_| 2333).await; | |
a2a8927a | 25 | | ^^^^^^ only allowed inside `async` functions and blocks |
dc9dc135 | 26 | |
f035d41b | 27 | error[E0277]: `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` is not a future |
a2a8927a | 28 | --> $DIR/issue-62009-1.rs:12:15 |
dc9dc135 XL |
29 | | |
30 | LL | (|_| 2333).await; | |
a2a8927a | 31 | | ^^^^^^ `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` is not a future |
dc9dc135 | 32 | | |
1b1a35ee | 33 | = help: the trait `Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` |
a2a8927a XL |
34 | = note: [closure@$DIR/issue-62009-1.rs:12:5: 12:15] must be a future or must implement `IntoFuture` to be awaited |
35 | = note: required because of the requirements on the impl of `IntoFuture` for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` | |
36 | help: remove the `.await` | |
37 | | | |
38 | LL - (|_| 2333).await; | |
39 | LL + (|_| 2333); | |
923072b8 | 40 | | |
dc9dc135 | 41 | |
416331ca | 42 | error: aborting due to 4 previous errors |
dc9dc135 | 43 | |
e74abb32 XL |
44 | Some errors have detailed explanations: E0277, E0728. |
45 | For more information about an error, try `rustc --explain E0277`. |