about summary refs log tree commit diff
path: root/compiler/rustc_parse
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-08-31 10:41:22 +0200
committerGitHub <noreply@github.com>2021-08-31 10:41:22 +0200
commit7696aca55f8f5820cbe80a2b455616f10a81af83 (patch)
tree07b3cc54ae0784e1576aabbc71f80f129d7ea84b /compiler/rustc_parse
parent2013792641122d7d4d5181ee596796df6b7ee85e (diff)
parentf7c0566b1209fc7c29d9621cb482acdf58dabd65 (diff)
downloadrust-7696aca55f8f5820cbe80a2b455616f10a81af83.tar.gz
rust-7696aca55f8f5820cbe80a2b455616f10a81af83.zip
Rollup merge of #88450 - notriddle:notriddle/maybe_whole_expr, r=cjgillot
fix(rustc_parse): correct span in `maybe_whole_expr!`

Fixes #87812
Diffstat (limited to 'compiler/rustc_parse')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index e71edbc861a..a1d3e9adba0 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -41,7 +41,7 @@ macro_rules! maybe_whole_expr {
                     let path = path.clone();
                     $p.bump();
                     return Ok($p.mk_expr(
-                        $p.token.span,
+                        $p.prev_token.span,
                         ExprKind::Path(None, path),
                         AttrVec::new(),
                     ));
@@ -50,7 +50,7 @@ macro_rules! maybe_whole_expr {
                     let block = block.clone();
                     $p.bump();
                     return Ok($p.mk_expr(
-                        $p.token.span,
+                        $p.prev_token.span,
                         ExprKind::Block(block, None),
                         AttrVec::new(),
                     ));