Skip to content

Commit 4e82da4

Browse files
rustc_parse: correct span on range expr with attrs
1 parent 7280f6a commit 4e82da4

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

compiler/rustc_parse/src/parser/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ impl<'a> Parser<'a> {
406406
None
407407
};
408408
let rhs_span = rhs.as_ref().map_or(cur_op_span, |x| x.span);
409-
let span = lhs.span.to(rhs_span);
409+
let span = self.mk_expr_sp(&lhs, lhs.span, rhs_span);
410410
let limits =
411411
if op == AssocOp::DotDot { RangeLimits::HalfOpen } else { RangeLimits::Closed };
412412
Ok(self.mk_expr(span, self.mk_range(Some(lhs), rhs, limits)?, AttrVec::new()))

0 commit comments

Comments
 (0)