diff options
| author | Caleb Cartwright <caleb.cartwright@outlook.com> | 2020-11-07 14:33:34 -0600 |
|---|---|---|
| committer | Caleb Cartwright <caleb.cartwright@outlook.com> | 2020-11-07 14:33:34 -0600 |
| commit | e1d5c3c0544b981c08581a0cf40c759d2f5bdff0 (patch) | |
| tree | f8f0c1033da4458d7e0eac17e85582887a5e3380 /compiler/rustc_parse/src/parser | |
| parent | b2d115f6db5172c961dfeb50de15f35784dbc7c9 (diff) | |
| download | rust-e1d5c3c0544b981c08581a0cf40c759d2f5bdff0.tar.gz rust-e1d5c3c0544b981c08581a0cf40c759d2f5bdff0.zip | |
fix(rustc_parse): ConstBlock expr span
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/mod.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index da1c54e88b5..c0c593ab591 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -873,7 +873,8 @@ impl<'a> Parser<'a> { id: DUMMY_NODE_ID, value: self.mk_expr(blk.span, ExprKind::Block(blk, None), AttrVec::new()), }; - Ok(self.mk_expr(span, ExprKind::ConstBlock(anon_const), AttrVec::new())) + let blk_span = anon_const.value.span; + Ok(self.mk_expr(span.to(blk_span), ExprKind::ConstBlock(anon_const), AttrVec::new())) } /// Parses mutability (`mut` or nothing). |
