]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issues/issue-62009-1.stderr
Rollup merge of #103766 - lukas-code:error-in-core, r=Dylan-DPC
[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:6: 12:9]` is not a future
28   --> $DIR/issue-62009-1.rs:12:15
29    |
30 LL |     (|_| 2333).await;
31    |               ^^^^^^
32    |               |
33    |               `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]` is not a future
34    |               help: remove the `.await`
35    |
36    = help: the trait `Future` is not implemented for closure `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]`
37    = note: [closure@$DIR/issue-62009-1.rs:12:6: 12:9] must be a future or must implement `IntoFuture` to be awaited
38    = note: required for `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]` to implement `IntoFuture`
39
40 error: aborting due to 4 previous errors
41
42 Some errors have detailed explanations: E0277, E0728.
43 For more information about an error, try `rustc --explain E0277`.