From f7c0566b1209fc7c29d9621cb482acdf58dabd65 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sat, 28 Aug 2021 17:35:39 -0700 Subject: 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 --- compiler/rustc_parse/src/parser/expr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_parse/src') 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(), )); -- cgit 1.4.1-3-g733a5