Skip to content

Commit e1d5c3c

Browse files
fix(rustc_parse): ConstBlock expr span
1 parent b2d115f commit e1d5c3c

File tree

1 file changed

+2
-1
lines changed
  • compiler/rustc_parse/src/parser

1 file changed

+2
-1
lines changed

compiler/rustc_parse/src/parser/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,8 @@ impl<'a> Parser<'a> {
873873
id: DUMMY_NODE_ID,
874874
value: self.mk_expr(blk.span, ExprKind::Block(blk, None), AttrVec::new()),
875875
};
876-
Ok(self.mk_expr(span, ExprKind::ConstBlock(anon_const), AttrVec::new()))
876+
let blk_span = anon_const.value.span;
877+
Ok(self.mk_expr(span.to(blk_span), ExprKind::ConstBlock(anon_const), AttrVec::new()))
877878
}
878879

879880
/// Parses mutability (`mut` or nothing).

0 commit comments

Comments
 (0)