1
Fork 0

remove subst_supertrait call

This commit is contained in:
b-naber 2020-11-30 09:28:16 +01:00
parent 6a68966663
commit 9e920151a3

View file

@ -257,13 +257,11 @@ fn predicates_reference_self(
} }
fn bounds_reference_self(tcx: TyCtxt<'_>, trait_def_id: DefId) -> SmallVec<[Span; 1]> { fn bounds_reference_self(tcx: TyCtxt<'_>, trait_def_id: DefId) -> SmallVec<[Span; 1]> {
let trait_ref = ty::Binder::dummy(ty::TraitRef::identity(tcx, trait_def_id));
tcx.associated_items(trait_def_id) tcx.associated_items(trait_def_id)
.in_definition_order() .in_definition_order()
.filter(|item| item.kind == ty::AssocKind::Type) .filter(|item| item.kind == ty::AssocKind::Type)
.flat_map(|item| tcx.explicit_item_bounds(item.def_id)) .flat_map(|item| tcx.explicit_item_bounds(item.def_id))
.map(|&(predicate, sp)| (predicate.subst_supertrait(tcx, &trait_ref), sp)) .filter_map(|pred_span| predicate_references_self(tcx, *pred_span))
.filter_map(|predicate| predicate_references_self(tcx, predicate))
.collect() .collect()
} }