test infra added
This commit is contained in:
parent
adb15a20ac
commit
6d256d9d0e
8
tests/ui/parser/issue-113203.rs
Normal file
8
tests/ui/parser/issue-113203.rs
Normal file
@ -0,0 +1,8 @@
|
||||
// Checks what happens when we attempt to use the await keyword as a prefix. Span
|
||||
// incorrectly emitted an `.await` in E0277 which does not exist
|
||||
// edition:2018
|
||||
fn main() {
|
||||
await {}()
|
||||
//~^ ERROR `await` is only allowed inside `async` functions and blocks
|
||||
//~| ERROR incorrect use of `await`
|
||||
}
|
30
tests/ui/parser/issue-113203.stderr
Normal file
30
tests/ui/parser/issue-113203.stderr
Normal file
@ -0,0 +1,30 @@
|
||||
error: incorrect use of `await`
|
||||
--> $DIR/issue-113203.rs:5:5
|
||||
|
|
||||
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[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`.
|
Loading…
x
Reference in New Issue
Block a user