]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issues/issue-62009-1.stderr
Merge commit '7b73b60faca71d01d900e49831fcb84553e93019' into sync-rustfmt
[rust.git] / src / test / ui / async-await / issues / issue-62009-1.stderr
1 error[E0728]: `await` is only allowed inside `async` functions and blocks
2   --> $DIR/issue-62009-1.rs:6:22
3    |
4 LL | fn main() {
5    |    ---- this is not `async`
6 LL |     async { let (); }.await;
7    |                      ^^^^^^ only allowed inside `async` functions and blocks
8
9 error[E0728]: `await` is only allowed inside `async` functions and blocks
10   --> $DIR/issue-62009-1.rs:10:6
11    |
12 LL | fn main() {
13    |    ---- this is not `async`
14 ...
15 LL |     }.await;
16    |      ^^^^^^ only allowed inside `async` functions and blocks
17
18 error[E0728]: `await` is only allowed inside `async` functions and blocks
19   --> $DIR/issue-62009-1.rs:12:15
20    |
21 LL | fn main() {
22    |    ---- this is not `async`
23 ...
24 LL |     (|_| 2333).await;
25    |               ^^^^^^ only allowed inside `async` functions and blocks
26
27 error[E0277]: `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` is not a future
28   --> $DIR/issue-62009-1.rs:12:15
29    |
30 LL |     (|_| 2333).await;
31    |               ^^^^^^ `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` is not a future
32    |
33    = help: the trait `Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]`
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);
40    | 
41
42 error: aborting due to 4 previous errors
43
44 Some errors have detailed explanations: E0277, E0728.
45 For more information about an error, try `rustc --explain E0277`.