2019-06-26 13:48:41 +01:00
|
|
|
error[E0728]: `await` is only allowed inside `async` functions and blocks
|
2020-04-01 04:10:13 +03:00
|
|
|
--> $DIR/issue-62009-1.rs:6:5
|
2019-06-26 13:48:41 +01:00
|
|
|
|
|
|
|
|
|
LL | fn main() {
|
|
|
|
|
| ---- this is not `async`
|
|
|
|
|
LL | async { let (); }.await;
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks
|
|
|
|
|
|
|
|
|
|
error[E0728]: `await` is only allowed inside `async` functions and blocks
|
2020-04-01 04:10:13 +03:00
|
|
|
--> $DIR/issue-62009-1.rs:8:5
|
2019-06-26 13:48:41 +01:00
|
|
|
|
|
|
|
|
|
LL | fn main() {
|
|
|
|
|
| ---- this is not `async`
|
|
|
|
|
...
|
|
|
|
|
LL | / async {
|
|
|
|
|
LL | |
|
|
|
|
|
LL | | let task1 = print_dur().await;
|
|
|
|
|
LL | | }.await;
|
|
|
|
|
| |___________^ only allowed inside `async` functions and blocks
|
|
|
|
|
|
|
|
|
|
error[E0728]: `await` is only allowed inside `async` functions and blocks
|
2020-04-01 04:10:13 +03:00
|
|
|
--> $DIR/issue-62009-1.rs:12:5
|
2019-06-26 13:48:41 +01:00
|
|
|
|
|
|
|
|
|
LL | fn main() {
|
|
|
|
|
| ---- this is not `async`
|
|
|
|
|
...
|
|
|
|
|
LL | (|_| 2333).await;
|
|
|
|
|
| ^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks
|
|
|
|
|
|
2020-06-18 10:30:47 -07:00
|
|
|
error[E0277]: `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` is not a future
|
2020-04-01 04:10:13 +03:00
|
|
|
--> $DIR/issue-62009-1.rs:12:5
|
2019-06-26 13:48:41 +01:00
|
|
|
|
|
|
|
|
|
LL | (|_| 2333).await;
|
2020-06-18 10:30:47 -07:00
|
|
|
| ^^^^^^^^^^^^^^^^ `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` is not a future
|
2019-06-26 13:48:41 +01:00
|
|
|
|
|
2020-09-02 10:40:56 +03:00
|
|
|
= help: the trait `Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]`
|
2021-12-02 11:36:48 -08:00
|
|
|
= note: [closure@$DIR/issue-62009-1.rs:12:5: 12:15] must be a future or must implement `IntoFuture` to be awaited
|
2021-11-22 15:58:17 -08:00
|
|
|
= note: required because of the requirements on the impl of `IntoFuture` for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]`
|
2019-06-26 13:48:41 +01:00
|
|
|
|
2019-07-02 04:12:29 +02:00
|
|
|
error: aborting due to 4 previous errors
|
2019-06-26 13:48:41 +01:00
|
|
|
|
2019-10-22 08:48:01 +09:00
|
|
|
Some errors have detailed explanations: E0277, E0728.
|
|
|
|
|
For more information about an error, try `rustc --explain E0277`.
|