Skip to content

Commit 0df12d7

Browse files
BoxyUwUlcnr
authored andcommitted
erase_regions to erase_and_anonymize_regions
1 parent 27250a3 commit 0df12d7

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

clippy_lints/src/dereference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ impl<'tcx> LateLintPass<'tcx> for Dereferencing<'tcx> {
364364
// priority.
365365
if let Some(fn_id) = typeck.type_dependent_def_id(hir_id)
366366
&& let Some(trait_id) = cx.tcx.trait_of_assoc(fn_id)
367-
&& let arg_ty = cx.tcx.erase_regions(adjusted_ty)
367+
&& let arg_ty = cx.tcx.erase_and_anonymize_regions(adjusted_ty)
368368
&& let ty::Ref(_, sub_ty, _) = *arg_ty.kind()
369369
&& let args =
370370
typeck.node_args_opt(hir_id).map(|args| &args[1..]).unwrap_or_default()

clippy_lints/src/loops/explicit_iter_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ fn is_ref_iterable<'tcx>(
140140

141141
let res_ty = cx
142142
.tcx
143-
.erase_regions(EarlyBinder::bind(req_res_ty).instantiate(cx.tcx, typeck.node_args(call_expr.hir_id)));
143+
.erase_and_anonymize_regions(EarlyBinder::bind(req_res_ty).instantiate(cx.tcx, typeck.node_args(call_expr.hir_id)));
144144
let mutbl = if let ty::Ref(_, _, mutbl) = *req_self_ty.kind() {
145145
Some(mutbl)
146146
} else {

clippy_lints/src/only_used_in_recursion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ impl<'tcx> LateLintPass<'tcx> for OnlyUsedInRecursion {
252252
{
253253
(
254254
trait_item_id,
255-
FnKind::ImplTraitFn(std::ptr::from_ref(cx.tcx.erase_regions(trait_ref.args)) as usize),
255+
FnKind::ImplTraitFn(std::ptr::from_ref(cx.tcx.erase_and_anonymize_regions(trait_ref.args)) as usize),
256256
usize::from(sig.decl.implicit_self.has_implicit_self()),
257257
)
258258
} else {

clippy_lints/src/transmute/transmute_ref_to_ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub(super) fn check<'tcx>(
4545
Applicability::MaybeIncorrect,
4646
);
4747
triggered = true;
48-
} else if (cx.tcx.erase_regions(from_ty) != cx.tcx.erase_regions(to_ty)) && !const_context {
48+
} else if (cx.tcx.erase_and_anonymize_regions(from_ty) != cx.tcx.erase_and_anonymize_regions(to_ty)) && !const_context {
4949
span_lint_and_then(
5050
cx,
5151
TRANSMUTE_PTR_TO_PTR,

clippy_lints/src/transmute/transmute_undefined_repr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ pub(super) fn check<'tcx>(
1212
from_ty_orig: Ty<'tcx>,
1313
to_ty_orig: Ty<'tcx>,
1414
) -> bool {
15-
let mut from_ty = cx.tcx.erase_regions(from_ty_orig);
16-
let mut to_ty = cx.tcx.erase_regions(to_ty_orig);
15+
let mut from_ty = cx.tcx.erase_and_anonymize_regions(from_ty_orig);
16+
let mut to_ty = cx.tcx.erase_and_anonymize_regions(to_ty_orig);
1717

1818
while from_ty != to_ty {
1919
let reduced_tys = reduce_refs(cx, from_ty, to_ty);

clippy_lints/src/useless_conversion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ fn into_iter_bound<'tcx>(
9898
if tr.def_id() == into_iter_did {
9999
into_iter_span = Some(*span);
100100
} else {
101-
let tr = cx.tcx.erase_regions(tr);
101+
let tr = cx.tcx.erase_and_anonymize_regions(tr);
102102
if tr.has_escaping_bound_vars() {
103103
return None;
104104
}

clippy_utils/src/ty/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ pub fn implements_trait_with_env_from_iter<'tcx>(
285285
let _ = tcx.hir_body_owner_kind(callee_id);
286286
}
287287

288-
let ty = tcx.erase_regions(ty);
288+
let ty = tcx.erase_and_anonymize_regions(ty);
289289
if ty.has_escaping_bound_vars() {
290290
return false;
291291
}

0 commit comments

Comments
 (0)