Skip to content

Commit

Permalink
Auto merge of rust-lang#110806 - WaffleLapkin:unmkI, r=lcnr
Browse files Browse the repository at this point in the history
Replace `tcx.mk_trait_ref` with `TraitRef::new`

First step in implementing rust-lang/compiler-team#616
r? `@lcnr`
  • Loading branch information
bors committed May 4, 2023
2 parents 431cce1 + 9564895 commit 8518391
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ fn param_env_for_derived_eq(tcx: TyCtxt<'_>, did: DefId, eq_trait_id: DefId) ->
tcx.mk_predicates_from_iter(ty_predicates.iter().map(|&(p, _)| p).chain(
params.iter().filter(|&&(_, needs_eq)| needs_eq).map(|&(param, _)| {
tcx.mk_predicate(Binder::dummy(PredicateKind::Clause(Clause::Trait(TraitPredicate {
trait_ref: tcx.mk_trait_ref(eq_trait_id, [tcx.mk_param_from_def(param)]),
trait_ref: ty::TraitRef::new(tcx, eq_trait_id, [tcx.mk_param_from_def(param)]),
constness: BoundConstness::NotConst,
polarity: ImplPolarity::Positive,
}))))
Expand Down
3 changes: 1 addition & 2 deletions clippy_lints/src/escape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ impl<'tcx> LateLintPass<'tcx> for BoxedLocal {
if trait_item.kind == (AssocItemKind::Fn { has_self: true }) {
trait_self_ty = Some(
TraitRef::identity(cx.tcx, trait_item.id.owner_id.to_def_id())
.self_ty()
.skip_binder(),
.self_ty(),
);
}
}
Expand Down
6 changes: 2 additions & 4 deletions clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3476,8 +3476,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
let first_arg_span = first_arg_ty.span;
let first_arg_ty = hir_ty_to_ty(cx.tcx, first_arg_ty);
let self_ty = TraitRef::identity(cx.tcx, item.owner_id.to_def_id())
.self_ty()
.skip_binder();
.self_ty();
wrong_self_convention::check(
cx,
item.ident.name.as_str(),
Expand All @@ -3495,8 +3494,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
if let TraitItemKind::Fn(_, _) = item.kind;
let ret_ty = return_ty(cx, item.owner_id);
let self_ty = TraitRef::identity(cx.tcx, item.owner_id.to_def_id())
.self_ty()
.skip_binder();
.self_ty();
if !ret_ty.contains(self_ty);

then {
Expand Down

0 comments on commit 8518391

Please sign in to comment.