Skip to content

Commit

Permalink
readd match await test case
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed May 16, 2019
1 parent c616605 commit 0183a57
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/test/ui/await-keyword/incorrect-syntax-suggestions.rs
Expand Up @@ -104,4 +104,8 @@ fn foo25() -> Result<(), ()> {
foo()
}

fn main() {}
fn main() {
match await { await => () }
//~^ ERROR expected expression, found `=>`
//~| ERROR incorrect use of `await`
} //~ ERROR expected one of `.`, `?`, `{`, or an operator, found `}`
27 changes: 26 additions & 1 deletion src/test/ui/await-keyword/incorrect-syntax-suggestions.stderr
Expand Up @@ -88,6 +88,31 @@ error: incorrect use of `await`
LL | let _ = bar().await()?;
| ^^ help: `await` is not a method call, remove the parentheses

error: expected expression, found `=>`
--> $DIR/incorrect-syntax-suggestions.rs:108:25
|
LL | match await { await => () }
| ----- ^^ expected expression
| |
| while parsing this incorrect await statement

error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:108:11
|
LL | match await { await => () }
| ^^^^^^^^^^^^^^^^^^^^^ help: `await` is not a statement: `{ await => () }.await`

error: expected one of `.`, `?`, `{`, or an operator, found `}`
--> $DIR/incorrect-syntax-suggestions.rs:111:1
|
LL | match await { await => () }
| ----- - expected one of `.`, `?`, `{`, or an operator here
| |
| while parsing this match expression
...
LL | }
| ^ unexpected token

error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/incorrect-syntax-suggestions.rs:55:13
|
Expand Down Expand Up @@ -177,6 +202,6 @@ LL | let _ = await bar()?;
= help: the trait `std::ops::Try` is not implemented for `impl std::future::Future`
= note: required by `std::ops::Try::into_result`

error: aborting due to 26 previous errors
error: aborting due to 29 previous errors

For more information about this error, try `rustc --explain E0277`.

0 comments on commit 0183a57

Please sign in to comment.