diff options
| author | Caleb Cartwright <caleb.cartwright@outlook.com> | 2020-10-12 12:24:24 -0500 |
|---|---|---|
| committer | Caleb Cartwright <caleb.cartwright@outlook.com> | 2020-10-12 12:24:24 -0500 |
| commit | 4e82da4a48d4cf86521608c6f1cf137a5765910b (patch) | |
| tree | d530fddd995779f3a374a9afe9c1643d652b89b7 /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 7280f6aa41edf77d2488511bd880ad1c509ec865 (diff) | |
| download | rust-4e82da4a48d4cf86521608c6f1cf137a5765910b.tar.gz rust-4e82da4a48d4cf86521608c6f1cf137a5765910b.zip | |
rustc_parse: correct span on range expr with attrs
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -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 649a86f219d..d0dfca73485 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -406,7 +406,7 @@ impl<'a> Parser<'a> { None }; let rhs_span = rhs.as_ref().map_or(cur_op_span, |x| x.span); - let span = lhs.span.to(rhs_span); + let span = self.mk_expr_sp(&lhs, lhs.span, rhs_span); let limits = if op == AssocOp::DotDot { RangeLimits::HalfOpen } else { RangeLimits::Closed }; Ok(self.mk_expr(span, self.mk_range(Some(lhs), rhs, limits)?, AttrVec::new())) |
