Add the span of attributes of the lhs to the span of the assignment expression
This commit is contained in:
parent
ec7ecb3076
commit
9851a29688
1 changed files with 8 additions and 0 deletions
|
@ -3455,6 +3455,14 @@ impl<'a> Parser<'a> {
|
|||
}),
|
||||
}?;
|
||||
|
||||
// Make sure that the span of the parent node is larger than the span of lhs and rhs,
|
||||
// including the attributes.
|
||||
let lhs_span = lhs
|
||||
.attrs
|
||||
.iter()
|
||||
.filter(|a| a.style == AttrStyle::Outer)
|
||||
.next()
|
||||
.map_or(lhs_span, |a| a.span);
|
||||
let span = lhs_span.to(rhs.span);
|
||||
lhs = match op {
|
||||
AssocOp::Add | AssocOp::Subtract | AssocOp::Multiply | AssocOp::Divide |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue