about summary refs log tree commit diff
path: root/clippy_lints/src/zero_repeat_side_effects.rs
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2024-06-13 12:18:48 +0200
committerPhilipp Krones <hello@philkrones.com>2024-06-13 12:24:08 +0200
commitcc63143bbf5ae28daae127902090492560313ca1 (patch)
tree3cf8901da2767e0e330b32ef8a1f8a3bf75adc0c /clippy_lints/src/zero_repeat_side_effects.rs
parent35f54fd439432f56c749fbb34f1326e34ed1fc42 (diff)
parentaaade2d12d3cf78fd9eb24bf7973e86433d6373d (diff)
Merge remote-tracking branch 'upstream/master' into rustup
Diffstat (limited to 'clippy_lints/src/zero_repeat_side_effects.rs')
-rw-r--r--clippy_lints/src/zero_repeat_side_effects.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/zero_repeat_side_effects.rs b/clippy_lints/src/zero_repeat_side_effects.rs
index 8796b8f61d1..ad041e55bda 100644
--- a/clippy_lints/src/zero_repeat_side_effects.rs
+++ b/clippy_lints/src/zero_repeat_side_effects.rs
@@ -1,7 +1,7 @@
 use clippy_utils::diagnostics::span_lint_and_sugg;
 use clippy_utils::higher::VecArgs;
 use clippy_utils::source::snippet;
-use clippy_utils::visitors::for_each_expr;
+use clippy_utils::visitors::for_each_expr_without_closures;
 use rustc_ast::LitKind;
 use rustc_errors::Applicability;
 use rustc_hir::{ExprKind, Node};
@@ -36,7 +36,7 @@ declare_clippy_lint! {
     /// side_effect();
     /// let a: [i32; 0] = [];
     /// ```
-    #[clippy::version = "1.75.0"]
+    #[clippy::version = "1.79.0"]
     pub ZERO_REPEAT_SIDE_EFFECTS,
     suspicious,
     "usage of zero-sized initializations of arrays or vecs causing side effects"
@@ -65,7 +65,7 @@ impl LateLintPass<'_> for ZeroRepeatSideEffects {
 
 fn inner_check(cx: &LateContext<'_>, expr: &'_ rustc_hir::Expr<'_>, inner_expr: &'_ rustc_hir::Expr<'_>, is_vec: bool) {
     // check if expr is a call or has a call inside it
-    if for_each_expr(inner_expr, |x| {
+    if for_each_expr_without_closures(inner_expr, |x| {
         if let ExprKind::Call(_, _) | ExprKind::MethodCall(_, _, _, _) = x.kind {
             std::ops::ControlFlow::Break(())
         } else {