Remove ToPolyTraitRef impl for TraitRef
This commit is contained in:
parent
be76bdf905
commit
c065f57111
9 changed files with 33 additions and 45 deletions
|
@ -250,7 +250,7 @@ fn predicates_reference_self(
|
|||
trait_def_id: DefId,
|
||||
supertraits_only: bool,
|
||||
) -> SmallVec<[Span; 1]> {
|
||||
let trait_ref = ty::Binder::dummy(ty::TraitRef::identity(tcx, trait_def_id));
|
||||
let trait_ref = ty::TraitRef::identity(tcx, trait_def_id);
|
||||
let predicates = if supertraits_only {
|
||||
tcx.super_predicates_of(trait_def_id)
|
||||
} else {
|
||||
|
@ -554,11 +554,11 @@ fn object_ty_for_trait<'tcx>(
|
|||
|
||||
let trait_ref = ty::TraitRef::identity(tcx, trait_def_id);
|
||||
|
||||
let trait_predicate = ty::Binder::dummy(ty::ExistentialPredicate::Trait(
|
||||
ty::ExistentialTraitRef::erase_self_ty(tcx, trait_ref),
|
||||
));
|
||||
let trait_predicate = trait_ref.map_bound(|trait_ref| {
|
||||
ty::ExistentialPredicate::Trait(ty::ExistentialTraitRef::erase_self_ty(tcx, trait_ref))
|
||||
});
|
||||
|
||||
let mut associated_types = traits::supertraits(tcx, ty::Binder::dummy(trait_ref))
|
||||
let mut associated_types = traits::supertraits(tcx, trait_ref)
|
||||
.flat_map(|super_trait_ref| {
|
||||
tcx.associated_items(super_trait_ref.def_id())
|
||||
.in_definition_order()
|
||||
|
@ -791,8 +791,7 @@ fn contains_illegal_self_type_reference<'tcx, T: TypeFoldable<'tcx>>(
|
|||
|
||||
// Compute supertraits of current trait lazily.
|
||||
if self.supertraits.is_none() {
|
||||
let trait_ref =
|
||||
ty::Binder::dummy(ty::TraitRef::identity(self.tcx, self.trait_def_id));
|
||||
let trait_ref = ty::TraitRef::identity(self.tcx, self.trait_def_id);
|
||||
self.supertraits = Some(
|
||||
traits::supertraits(self.tcx, trait_ref).map(|t| t.def_id()).collect(),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue