From d562848268e02d6cf342598551bc663fcd4ff341 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sat, 28 Aug 2021 17:28:39 -0700 Subject: fix(rustc_parse): incorrect span information for macro block expr Old error output: = note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) help: wrap this expression in parentheses | 4 | break '_l $f(;) | ^ ^ New error output: = note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) help: wrap this expression in parentheses | 4 | break '_l ($f); | ^ ^ --- compiler/rustc_parse/src/parser/expr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_parse/src/parser') diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 326c8f81ffb..bb7e44b18d2 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -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(), )); -- cgit 1.4.1-3-g733a5