Auto merge of #110806 - WaffleLapkin:unmkI, r=lcnr
Replace `tcx.mk_trait_ref` with `TraitRef::new` First step in implementing https://github.com/rust-lang/compiler-team/issues/616 r? `@lcnr`
This commit is contained in:
commit
8518391e72
@ -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(
|
tcx.mk_predicates_from_iter(ty_predicates.iter().map(|&(p, _)| p).chain(
|
||||||
params.iter().filter(|&&(_, needs_eq)| needs_eq).map(|&(param, _)| {
|
params.iter().filter(|&&(_, needs_eq)| needs_eq).map(|&(param, _)| {
|
||||||
tcx.mk_predicate(Binder::dummy(PredicateKind::Clause(Clause::Trait(TraitPredicate {
|
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,
|
constness: BoundConstness::NotConst,
|
||||||
polarity: ImplPolarity::Positive,
|
polarity: ImplPolarity::Positive,
|
||||||
}))))
|
}))))
|
||||||
|
@ -94,8 +94,7 @@ impl<'tcx> LateLintPass<'tcx> for BoxedLocal {
|
|||||||
if trait_item.kind == (AssocItemKind::Fn { has_self: true }) {
|
if trait_item.kind == (AssocItemKind::Fn { has_self: true }) {
|
||||||
trait_self_ty = Some(
|
trait_self_ty = Some(
|
||||||
TraitRef::identity(cx.tcx, trait_item.id.owner_id.to_def_id())
|
TraitRef::identity(cx.tcx, trait_item.id.owner_id.to_def_id())
|
||||||
.self_ty()
|
.self_ty(),
|
||||||
.skip_binder(),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3476,8 +3476,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
|
|||||||
let first_arg_span = first_arg_ty.span;
|
let first_arg_span = first_arg_ty.span;
|
||||||
let first_arg_ty = hir_ty_to_ty(cx.tcx, first_arg_ty);
|
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())
|
let self_ty = TraitRef::identity(cx.tcx, item.owner_id.to_def_id())
|
||||||
.self_ty()
|
.self_ty();
|
||||||
.skip_binder();
|
|
||||||
wrong_self_convention::check(
|
wrong_self_convention::check(
|
||||||
cx,
|
cx,
|
||||||
item.ident.name.as_str(),
|
item.ident.name.as_str(),
|
||||||
@ -3495,8 +3494,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
|
|||||||
if let TraitItemKind::Fn(_, _) = item.kind;
|
if let TraitItemKind::Fn(_, _) = item.kind;
|
||||||
let ret_ty = return_ty(cx, item.owner_id);
|
let ret_ty = return_ty(cx, item.owner_id);
|
||||||
let self_ty = TraitRef::identity(cx.tcx, item.owner_id.to_def_id())
|
let self_ty = TraitRef::identity(cx.tcx, item.owner_id.to_def_id())
|
||||||
.self_ty()
|
.self_ty();
|
||||||
.skip_binder();
|
|
||||||
if !ret_ty.contains(self_ty);
|
if !ret_ty.contains(self_ty);
|
||||||
|
|
||||||
then {
|
then {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user