We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec7ecb3 commit 9851a29Copy full SHA for 9851a29
src/libsyntax/parse/parser.rs
@@ -3455,6 +3455,14 @@ impl<'a> Parser<'a> {
3455
}),
3456
}?;
3457
3458
+ // Make sure that the span of the parent node is larger than the span of lhs and rhs,
3459
+ // including the attributes.
3460
+ let lhs_span = lhs
3461
+ .attrs
3462
+ .iter()
3463
+ .filter(|a| a.style == AttrStyle::Outer)
3464
+ .next()
3465
+ .map_or(lhs_span, |a| a.span);
3466
let span = lhs_span.to(rhs.span);
3467
lhs = match op {
3468
AssocOp::Add | AssocOp::Subtract | AssocOp::Multiply | AssocOp::Divide |
0 commit comments