fix tests

This commit is contained in:
darklyspaced 2023-08-07 22:31:32 +08:00
parent 6d256d9d0e
commit 9ed5267e61
No known key found for this signature in database
2 changed files with 2 additions and 25 deletions

View File

@ -3,6 +3,5 @@
// edition:2018
fn main() {
await {}()
//~^ ERROR `await` is only allowed inside `async` functions and blocks
//~| ERROR incorrect use of `await`
//~^ ERROR incorrect use of `await`
}

View File

@ -4,27 +4,5 @@ error: incorrect use of `await`
LL | await {}()
| ^^^^^^^^ help: `await` is a postfix operation: `{}.await`
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/issue-113203.rs:5:5
|
LL | fn main() {
| ---- this is not `async`
LL | await {}()
| ^^^^^ only allowed inside `async` functions and blocks
error: aborting due to previous error
error[E0277]: `()` is not a future
--> $DIR/issue-113203.rs:5:5
|
LL | await {}()
| ^^^^^ - help: remove the `.await`
| |
| `()` is not a future
|
= help: the trait `Future` is not implemented for `()`
= note: () must be a future or must implement `IntoFuture` to be awaited
= note: required for `()` to implement `IntoFuture`
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0277, E0728.
For more information about an error, try `rustc --explain E0277`.