Skip to content

Commit 9f89421

Browse files
committed
Auto merge of rust-lang#132301 - compiler-errors:adjust, r=lcnr
Remove region from adjustments It's not necessary to store this region, because it's only used in THIR and MemCat/ExprUse, both of which already basically only deal with erased regions anyways.
2 parents d9a0fec + 353868a commit 9f89421

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

clippy_lints/src/dereference.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ impl<'tcx> LateLintPass<'tcx> for Dereferencing<'tcx> {
418418
let (required_refs, msg) = if can_auto_borrow {
419419
(1, if deref_count == 1 { borrow_msg } else { deref_msg })
420420
} else if let Some(&Adjustment {
421-
kind: Adjust::Borrow(AutoBorrow::Ref(_, mutability)),
421+
kind: Adjust::Borrow(AutoBorrow::Ref(mutability)),
422422
..
423423
}) = next_adjust
424424
&& matches!(mutability, AutoBorrowMutability::Mut { .. })

clippy_lints/src/loops/explicit_into_iter_loop.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub(super) fn check(cx: &LateContext<'_>, self_arg: &Expr<'_>, call_expr: &Expr<
5353
[] => AdjustKind::None,
5454
&[
5555
Adjustment {
56-
kind: Adjust::Borrow(AutoBorrow::Ref(_, mutbl)),
56+
kind: Adjust::Borrow(AutoBorrow::Ref(mutbl)),
5757
..
5858
},
5959
] => AdjustKind::borrow(mutbl),
@@ -62,7 +62,7 @@ pub(super) fn check(cx: &LateContext<'_>, self_arg: &Expr<'_>, call_expr: &Expr<
6262
kind: Adjust::Deref(_), ..
6363
},
6464
Adjustment {
65-
kind: Adjust::Borrow(AutoBorrow::Ref(_, mutbl)),
65+
kind: Adjust::Borrow(AutoBorrow::Ref(mutbl)),
6666
target,
6767
},
6868
] => {

clippy_lints/src/loops/explicit_iter_loop.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ fn is_ref_iterable<'tcx>(
199199
kind: Adjust::Deref(_), ..
200200
},
201201
Adjustment {
202-
kind: Adjust::Borrow(AutoBorrow::Ref(_, mutbl)),
202+
kind: Adjust::Borrow(AutoBorrow::Ref(mutbl)),
203203
target,
204204
},
205205
..,
@@ -236,7 +236,7 @@ fn is_ref_iterable<'tcx>(
236236
},
237237
&[
238238
Adjustment {
239-
kind: Adjust::Borrow(AutoBorrow::Ref(_, mutbl)),
239+
kind: Adjust::Borrow(AutoBorrow::Ref(mutbl)),
240240
target,
241241
},
242242
..,

clippy_lints/src/methods/manual_inspect.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub(crate) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, arg: &Expr<'_>, name:
137137
_ if matches!(
138138
typeck.expr_adjustments(prev_expr).first(),
139139
Some(Adjustment {
140-
kind: Adjust::Borrow(AutoBorrow::Ref(_, AutoBorrowMutability::Not))
140+
kind: Adjust::Borrow(AutoBorrow::Ref(AutoBorrowMutability::Not))
141141
| Adjust::Deref(_),
142142
..
143143
})
@@ -230,7 +230,7 @@ fn check_use<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) -> (UseKind<'tcx>,
230230
if use_cx
231231
.adjustments
232232
.first()
233-
.is_some_and(|a| matches!(a.kind, Adjust::Borrow(AutoBorrow::Ref(_, AutoBorrowMutability::Not)))) =>
233+
.is_some_and(|a| matches!(a.kind, Adjust::Borrow(AutoBorrow::Ref(AutoBorrowMutability::Not)))) =>
234234
{
235235
UseKind::AutoBorrowed
236236
},

clippy_lints/src/redundant_slicing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl<'tcx> LateLintPass<'tcx> for RedundantSlicing {
110110
) || cx.typeck_results().expr_adjustments(expr).first().map_or(false, |a| {
111111
matches!(
112112
a.kind,
113-
Adjust::Borrow(AutoBorrow::Ref(_, AutoBorrowMutability::Mut { .. }))
113+
Adjust::Borrow(AutoBorrow::Ref(AutoBorrowMutability::Mut { .. }))
114114
)
115115
}) || (matches!(
116116
cx.typeck_results().expr_ty(indexed).ref_mutability(),

0 commit comments

Comments
 (0)