Skip to content

Commit 8518391

Browse files
committed
Auto merge of rust-lang#110806 - WaffleLapkin:unmkI, r=lcnr
Replace `tcx.mk_trait_ref` with `TraitRef::new` First step in implementing rust-lang/compiler-team#616 r? `@lcnr`
2 parents 431cce1 + 9564895 commit 8518391

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

clippy_lints/src/derive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ fn param_env_for_derived_eq(tcx: TyCtxt<'_>, did: DefId, eq_trait_id: DefId) ->
517517
tcx.mk_predicates_from_iter(ty_predicates.iter().map(|&(p, _)| p).chain(
518518
params.iter().filter(|&&(_, needs_eq)| needs_eq).map(|&(param, _)| {
519519
tcx.mk_predicate(Binder::dummy(PredicateKind::Clause(Clause::Trait(TraitPredicate {
520-
trait_ref: tcx.mk_trait_ref(eq_trait_id, [tcx.mk_param_from_def(param)]),
520+
trait_ref: ty::TraitRef::new(tcx, eq_trait_id, [tcx.mk_param_from_def(param)]),
521521
constness: BoundConstness::NotConst,
522522
polarity: ImplPolarity::Positive,
523523
}))))

clippy_lints/src/escape.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ impl<'tcx> LateLintPass<'tcx> for BoxedLocal {
9494
if trait_item.kind == (AssocItemKind::Fn { has_self: true }) {
9595
trait_self_ty = Some(
9696
TraitRef::identity(cx.tcx, trait_item.id.owner_id.to_def_id())
97-
.self_ty()
98-
.skip_binder(),
97+
.self_ty(),
9998
);
10099
}
101100
}

clippy_lints/src/methods/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3476,8 +3476,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
34763476
let first_arg_span = first_arg_ty.span;
34773477
let first_arg_ty = hir_ty_to_ty(cx.tcx, first_arg_ty);
34783478
let self_ty = TraitRef::identity(cx.tcx, item.owner_id.to_def_id())
3479-
.self_ty()
3480-
.skip_binder();
3479+
.self_ty();
34813480
wrong_self_convention::check(
34823481
cx,
34833482
item.ident.name.as_str(),
@@ -3495,8 +3494,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
34953494
if let TraitItemKind::Fn(_, _) = item.kind;
34963495
let ret_ty = return_ty(cx, item.owner_id);
34973496
let self_ty = TraitRef::identity(cx.tcx, item.owner_id.to_def_id())
3498-
.self_ty()
3499-
.skip_binder();
3497+
.self_ty();
35003498
if !ret_ty.contains(self_ty);
35013499

35023500
then {

0 commit comments

Comments
 (0)