Rollup merge of #60691 - topecongiro:await-macro-span, r=Centril

Include expression to wait for to the span of Await

Currently the span of `await!` only includes itself:

```rust
    await!(3);
//  ^^^^^
```

This PR changes it so that the span holds the whole `await!` expression:

```rust
    await!(3);
//  ^^^^^^^^^
This commit is contained in:
Mazdak Farrokhzad 2019-05-16 10:43:30 +02:00 committed by GitHub
commit 013e4daa41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -2635,6 +2635,7 @@ impl<'a> Parser<'a> {
self.expect(&token::OpenDelim(token::Paren))?;
let expr = self.parse_expr()?;
self.expect(&token::CloseDelim(token::Paren))?;
hi = self.prev_span;
ex = ExprKind::Await(ast::AwaitOrigin::MacroLike, expr);
} else if self.token.is_path_start() {
let path = self.parse_path(PathStyle::Expr)?;

View File

@ -2,7 +2,7 @@ error[E0658]: `await!(<expr>)` macro syntax is unstable, and will soon be remove
--> $DIR/await-macro.rs:9:5
|
LL | await!(bar());
| ^^^^^
| ^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/50547
= help: add #![feature(await_macro)] to the crate attributes to enable