fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.6 KiB43 linesraw
1error[E0728]: `await` is only allowed inside `async` functions and blocks
2  --> $DIR/issue-62009-1.rs:6:23
3   |
4LL | fn main() {
5   |    ---- this is not `async`
6LL |     async { let (); }.await;
7   |                       ^^^^^ only allowed inside `async` functions and blocks
8
9error[E0728]: `await` is only allowed inside `async` functions and blocks
10  --> $DIR/issue-62009-1.rs:10:7
11   |
12LL | fn main() {
13   |    ---- this is not `async`
14...
15LL |     }.await;
16   |       ^^^^^ only allowed inside `async` functions and blocks
17
18error[E0728]: `await` is only allowed inside `async` functions and blocks
19  --> $DIR/issue-62009-1.rs:12:16
20   |
21LL | fn main() {
22   |    ---- this is not `async`
23...
24LL |     (|_| 2333).await;
25   |                ^^^^^ only allowed inside `async` functions and blocks
26
27error[E0277]: `{closure@$DIR/issue-62009-1.rs:12:6: 12:9}` is not a future
28  --> $DIR/issue-62009-1.rs:12:16
29   |
30LL |     (|_| 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
40error: aborting due to 4 previous errors
41
42Some errors have detailed explanations: E0277, E0728.
43For more information about an error, try `rustc --explain E0277`.