about summary refs log tree commit diff
path: root/clippy_lints/src/missing_fields_in_debug.rs
diff options
context:
space:
mode:
authorAlex Macleod <alex@macleod.io>2024-05-17 16:45:00 +0000
committerAlex Macleod <alex@macleod.io>2024-05-19 16:47:02 +0000
commite6040437ef5e6f2ac8110fd160c58ec2fa8ad202 (patch)
tree8c0080445f3be3501f67abbf136b39802c329f56 /clippy_lints/src/missing_fields_in_debug.rs
parent680256f3ce369da4d305bb4e0c037672d2625b8b (diff)
Swap `for_each_expr` and `for_each_expr_with_closures`
Diffstat (limited to 'clippy_lints/src/missing_fields_in_debug.rs')
-rw-r--r--clippy_lints/src/missing_fields_in_debug.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/missing_fields_in_debug.rs b/clippy_lints/src/missing_fields_in_debug.rs
index a64faa124f0..10f6cb7c0d3 100644
--- a/clippy_lints/src/missing_fields_in_debug.rs
+++ b/clippy_lints/src/missing_fields_in_debug.rs
@@ -3,7 +3,7 @@ use std::ops::ControlFlow;
 use clippy_utils::diagnostics::span_lint_and_then;
 use clippy_utils::is_path_lang_item;
 use clippy_utils::ty::is_type_diagnostic_item;
-use clippy_utils::visitors::{for_each_expr, Visitable};
+use clippy_utils::visitors::{for_each_expr_without_closures, Visitable};
 use rustc_ast::LitKind;
 use rustc_data_structures::fx::FxHashSet;
 use rustc_hir::def::{DefKind, Res};
@@ -110,7 +110,7 @@ fn should_lint<'tcx>(
     // Is there a call to `DebugStruct::debug_struct`? Do lint if there is.
     let mut has_debug_struct = false;
 
-    for_each_expr(block, |expr| {
+    for_each_expr_without_closures(block, |expr| {
         if let ExprKind::MethodCall(path, recv, ..) = &expr.kind {
             let recv_ty = typeck_results.expr_ty(recv).peel_refs();
 
@@ -165,7 +165,7 @@ fn check_struct<'tcx>(
     let mut has_direct_field_access = false;
     let mut field_accesses = FxHashSet::default();
 
-    for_each_expr(block, |expr| {
+    for_each_expr_without_closures(block, |expr| {
         if let ExprKind::Field(target, ident) = expr.kind
             && let target_ty = typeck_results.expr_ty_adjusted(target).peel_refs()
             && target_ty == self_ty