diff options
| author | Michael Howell <michael@notriddle.com> | 2021-08-28 17:35:39 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2021-08-28 20:56:55 -0700 |
| commit | f7c0566b1209fc7c29d9621cb482acdf58dabd65 (patch) | |
| tree | 4e6a2c7ef925ea5f6e4535d53cce46fc07641a2b /compiler/rustc_parse/src/parser | |
| parent | d562848268e02d6cf342598551bc663fcd4ff341 (diff) | |
| download | rust-f7c0566b1209fc7c29d9621cb482acdf58dabd65.tar.gz rust-f7c0566b1209fc7c29d9621cb482acdf58dabd65.zip | |
fix(rustc_parse): incorrect span information for macro path expr
Old error output:
3 | let _: usize = $f;
| ----- ^ expected `usize`, found struct `Baz`
| |
| expected due to this
New error output:
3 | let _: usize = $f;
| ----- ^^ expected `usize`, found struct `Baz`
| |
| expected due to this
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index bb7e44b18d2..eea6c482cf1 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(), )); |
