diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-05-16 13:20:06 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-05-16 13:58:44 -0700 |
| commit | 0183a575f686003586ca3308db8a55d6224f4789 (patch) | |
| tree | 32d6400dbf173e8522559b2c51e8caa0b9288df4 | |
| parent | c61660500555c81d6049b7e7b5b502d1bd9df80f (diff) | |
| download | rust-0183a575f686003586ca3308db8a55d6224f4789.tar.gz rust-0183a575f686003586ca3308db8a55d6224f4789.zip | |
readd match await test case
| -rw-r--r-- | src/test/ui/await-keyword/incorrect-syntax-suggestions.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/await-keyword/incorrect-syntax-suggestions.stderr | 27 |
2 files changed, 31 insertions, 2 deletions
diff --git a/src/test/ui/await-keyword/incorrect-syntax-suggestions.rs b/src/test/ui/await-keyword/incorrect-syntax-suggestions.rs index 6b615cc9ff9..e1e5bdd3d1b 100644 --- a/src/test/ui/await-keyword/incorrect-syntax-suggestions.rs +++ b/src/test/ui/await-keyword/incorrect-syntax-suggestions.rs @@ -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 `}` diff --git a/src/test/ui/await-keyword/incorrect-syntax-suggestions.stderr b/src/test/ui/await-keyword/incorrect-syntax-suggestions.stderr index 5ea59d4bcee..bc7bd77479e 100644 --- a/src/test/ui/await-keyword/incorrect-syntax-suggestions.stderr +++ b/src/test/ui/await-keyword/incorrect-syntax-suggestions.stderr @@ -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 | @@ -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`. |
