@@ -3,7 +3,7 @@ use std::ops::ControlFlow;
33
44use clippy_utils:: consts:: { constant, Constant } ;
55use clippy_utils:: diagnostics:: span_lint;
6- use clippy_utils:: visitors:: { for_each_expr , Descend } ;
6+ use clippy_utils:: visitors:: { for_each_expr_without_closures , Descend } ;
77use clippy_utils:: { method_chain_args, sext} ;
88use rustc_hir:: { BinOpKind , Expr , ExprKind } ;
99use rustc_lint:: LateContext ;
@@ -266,7 +266,7 @@ fn expr_add_sign(cx: &LateContext<'_>, expr: &Expr<'_>) -> Sign {
266266fn exprs_with_muldiv_binop_peeled < ' e > ( expr : & ' e Expr < ' _ > ) -> Vec < & ' e Expr < ' e > > {
267267 let mut res = vec ! [ ] ;
268268
269- for_each_expr ( expr, |sub_expr| -> ControlFlow < Infallible , Descend > {
269+ for_each_expr_without_closures ( expr, |sub_expr| -> ControlFlow < Infallible , Descend > {
270270 // We don't check for mul/div/rem methods here, but we could.
271271 if let ExprKind :: Binary ( op, lhs, _rhs) = sub_expr. kind {
272272 if matches ! ( op. node, BinOpKind :: Mul | BinOpKind :: Div ) {
@@ -315,7 +315,7 @@ fn exprs_with_muldiv_binop_peeled<'e>(expr: &'e Expr<'_>) -> Vec<&'e Expr<'e>> {
315315fn exprs_with_add_binop_peeled < ' e > ( expr : & ' e Expr < ' _ > ) -> Vec < & ' e Expr < ' e > > {
316316 let mut res = vec ! [ ] ;
317317
318- for_each_expr ( expr, |sub_expr| -> ControlFlow < Infallible , Descend > {
318+ for_each_expr_without_closures ( expr, |sub_expr| -> ControlFlow < Infallible , Descend > {
319319 // We don't check for add methods here, but we could.
320320 if let ExprKind :: Binary ( op, _lhs, _rhs) = sub_expr. kind {
321321 if matches ! ( op. node, BinOpKind :: Add ) {
0 commit comments