about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-05-16 10:43:30 +0200
committerGitHub <noreply@github.com>2019-05-16 10:43:30 +0200
commit013e4daa41048fb5ddf6cc3fc92421153a4e9cf4 (patch)
tree15f7d62979f82060e333c390ca0088a4a705f460 /src/libsyntax/parse/parser.rs
parent250fe9b37e4723c92d4edc0fc5d56a7ccd36db87 (diff)
parent1ea7c5fb2039933c67af8ba8629694733c0cd36e (diff)
downloadrust-013e4daa41048fb5ddf6cc3fc92421153a4e9cf4.tar.gz
rust-013e4daa41048fb5ddf6cc3fc92421153a4e9cf4.zip
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);
//  ^^^^^^^^^
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 2d6c8c54075..99e8db9d8e6 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -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)?;