Skip to content

Commit e0b68ae

Browse files
Rollup merge of rust-lang#89001 - jackh726:binder-cleanup, r=nikomatsakis
Be explicit about using Binder::dummy This is somewhat of a late followup to the binder refactor PR. It removes `ToPredicate` and `ToPolyTraitImpls` that hide the use of `Binder::dummy`. While this does make code a bit more verbose, it allows us be more careful about where we create binders. Another alternative here might be to add a new trait `ToBinder` or something with a `dummy()` fn. Which could still allow grepping but allows doing something like `trait_ref.dummy()` (but I also wonder if longer-term, it would be better to be even more explicit with a `bind_with_vars(ty::List::empty())` *but* that's not clear yet. r? ``@nikomatsakis``
2 parents edaeacf + 2a9a9ca commit e0b68ae

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clippy_lints/src/escape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<'tcx> LateLintPass<'tcx> for BoxedLocal {
9292
// be sure we have `self` parameter in this function
9393
if let AssocItemKind::Fn { has_self: true } = trait_item.kind {
9494
trait_self_ty =
95-
Some(TraitRef::identity(cx.tcx, trait_item.id.def_id.to_def_id()).self_ty());
95+
Some(TraitRef::identity(cx.tcx, trait_item.id.def_id.to_def_id()).self_ty().skip_binder());
9696
}
9797
}
9898
}

clippy_lints/src/methods/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2061,7 +2061,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
20612061
then {
20622062
let first_arg_span = first_arg_ty.span;
20632063
let first_arg_ty = hir_ty_to_ty(cx.tcx, first_arg_ty);
2064-
let self_ty = TraitRef::identity(cx.tcx, item.def_id.to_def_id()).self_ty();
2064+
let self_ty = TraitRef::identity(cx.tcx, item.def_id.to_def_id()).self_ty().skip_binder();
20652065
wrong_self_convention::check(
20662066
cx,
20672067
&item.ident.name.as_str(),
@@ -2078,7 +2078,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
20782078
if item.ident.name == sym::new;
20792079
if let TraitItemKind::Fn(_, _) = item.kind;
20802080
let ret_ty = return_ty(cx, item.hir_id());
2081-
let self_ty = TraitRef::identity(cx.tcx, item.def_id.to_def_id()).self_ty();
2081+
let self_ty = TraitRef::identity(cx.tcx, item.def_id.to_def_id()).self_ty().skip_binder();
20822082
if !contains_ty(cx.tcx, ret_ty, self_ty);
20832083

20842084
then {

0 commit comments

Comments
 (0)