From 353868aa64283e434c2e131678f97de0da1a6b00 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Tue, 29 Oct 2024 01:34:06 +0000 Subject: [PATCH] Remove region from adjustments --- clippy_lints/src/dereference.rs | 2 +- clippy_lints/src/loops/explicit_into_iter_loop.rs | 4 ++-- clippy_lints/src/loops/explicit_iter_loop.rs | 4 ++-- clippy_lints/src/methods/manual_inspect.rs | 4 ++-- clippy_lints/src/redundant_slicing.rs | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/clippy_lints/src/dereference.rs b/clippy_lints/src/dereference.rs index f34f5e05606..b167d7f2208 100644 --- a/clippy_lints/src/dereference.rs +++ b/clippy_lints/src/dereference.rs @@ -418,7 +418,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { let (required_refs, msg) = if can_auto_borrow { (1, if deref_count == 1 { borrow_msg } else { deref_msg }) } else if let Some(&Adjustment { - kind: Adjust::Borrow(AutoBorrow::Ref(_, mutability)), + kind: Adjust::Borrow(AutoBorrow::Ref(mutability)), .. }) = next_adjust && matches!(mutability, AutoBorrowMutability::Mut { .. }) diff --git a/clippy_lints/src/loops/explicit_into_iter_loop.rs b/clippy_lints/src/loops/explicit_into_iter_loop.rs index 93d6b808646..d5ddc33e928 100644 --- a/clippy_lints/src/loops/explicit_into_iter_loop.rs +++ b/clippy_lints/src/loops/explicit_into_iter_loop.rs @@ -53,7 +53,7 @@ pub(super) fn check(cx: &LateContext<'_>, self_arg: &Expr<'_>, call_expr: &Expr< [] => AdjustKind::None, &[ Adjustment { - kind: Adjust::Borrow(AutoBorrow::Ref(_, mutbl)), + kind: Adjust::Borrow(AutoBorrow::Ref(mutbl)), .. }, ] => AdjustKind::borrow(mutbl), @@ -62,7 +62,7 @@ pub(super) fn check(cx: &LateContext<'_>, self_arg: &Expr<'_>, call_expr: &Expr< kind: Adjust::Deref(_), .. }, Adjustment { - kind: Adjust::Borrow(AutoBorrow::Ref(_, mutbl)), + kind: Adjust::Borrow(AutoBorrow::Ref(mutbl)), target, }, ] => { diff --git a/clippy_lints/src/loops/explicit_iter_loop.rs b/clippy_lints/src/loops/explicit_iter_loop.rs index 022c6bcc70b..119e410b91c 100644 --- a/clippy_lints/src/loops/explicit_iter_loop.rs +++ b/clippy_lints/src/loops/explicit_iter_loop.rs @@ -199,7 +199,7 @@ fn is_ref_iterable<'tcx>( kind: Adjust::Deref(_), .. }, Adjustment { - kind: Adjust::Borrow(AutoBorrow::Ref(_, mutbl)), + kind: Adjust::Borrow(AutoBorrow::Ref(mutbl)), target, }, .., @@ -236,7 +236,7 @@ fn is_ref_iterable<'tcx>( }, &[ Adjustment { - kind: Adjust::Borrow(AutoBorrow::Ref(_, mutbl)), + kind: Adjust::Borrow(AutoBorrow::Ref(mutbl)), target, }, .., diff --git a/clippy_lints/src/methods/manual_inspect.rs b/clippy_lints/src/methods/manual_inspect.rs index 64c19c327b2..223b0630bfd 100644 --- a/clippy_lints/src/methods/manual_inspect.rs +++ b/clippy_lints/src/methods/manual_inspect.rs @@ -137,7 +137,7 @@ pub(crate) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, arg: &Expr<'_>, name: _ if matches!( typeck.expr_adjustments(prev_expr).first(), Some(Adjustment { - kind: Adjust::Borrow(AutoBorrow::Ref(_, AutoBorrowMutability::Not)) + kind: Adjust::Borrow(AutoBorrow::Ref(AutoBorrowMutability::Not)) | Adjust::Deref(_), .. }) @@ -230,7 +230,7 @@ fn check_use<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) -> (UseKind<'tcx>, if use_cx .adjustments .first() - .is_some_and(|a| matches!(a.kind, Adjust::Borrow(AutoBorrow::Ref(_, AutoBorrowMutability::Not)))) => + .is_some_and(|a| matches!(a.kind, Adjust::Borrow(AutoBorrow::Ref(AutoBorrowMutability::Not)))) => { UseKind::AutoBorrowed }, diff --git a/clippy_lints/src/redundant_slicing.rs b/clippy_lints/src/redundant_slicing.rs index 1c10e84d3ca..030df535c35 100644 --- a/clippy_lints/src/redundant_slicing.rs +++ b/clippy_lints/src/redundant_slicing.rs @@ -110,7 +110,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { ) || cx.typeck_results().expr_adjustments(expr).first().map_or(false, |a| { matches!( a.kind, - Adjust::Borrow(AutoBorrow::Ref(_, AutoBorrowMutability::Mut { .. })) + Adjust::Borrow(AutoBorrow::Ref(AutoBorrowMutability::Mut { .. })) ) }) || (matches!( cx.typeck_results().expr_ty(indexed).ref_mutability(),