Skip to content

Commit a2eca35

Browse files
committed
Visit BinOp span in MutVisitor::visit_expr
1 parent 42b4b9c commit a2eca35

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

compiler/rustc_ast/src/mut_visit.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,9 +1628,10 @@ pub fn walk_expr<T: MutVisitor>(vis: &mut T, Expr { kind, id, span, attrs, token
16281628
visit_thin_exprs(vis, call_args);
16291629
vis.visit_span(span);
16301630
}
1631-
ExprKind::Binary(_binop, lhs, rhs) => {
1631+
ExprKind::Binary(binop, lhs, rhs) => {
16321632
vis.visit_expr(lhs);
16331633
vis.visit_expr(rhs);
1634+
vis.visit_span(&mut binop.span);
16341635
}
16351636
ExprKind::Unary(_unop, ohs) => vis.visit_expr(ohs),
16361637
ExprKind::Cast(expr, ty) => {

tests/ui-fulldeps/pprust-parenthesis-insertion.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,6 @@ impl MutVisitor for Normalize {
165165
*span = DUMMY_SP;
166166
}
167167

168-
fn visit_expr(&mut self, expr: &mut P<Expr>) {
169-
if let ExprKind::Binary(binop, _left, _right) = &mut expr.kind {
170-
self.visit_span(&mut binop.span);
171-
}
172-
mut_visit::walk_expr(self, expr);
173-
}
174-
175168
fn flat_map_stmt(&mut self, mut stmt: Stmt) -> SmallVec<[Stmt; 1]> {
176169
self.visit_span(&mut stmt.span);
177170
mut_visit::walk_flat_map_stmt(self, stmt)

0 commit comments

Comments
 (0)