Skip to content

Commit

Permalink
remove subst_supertrait call
Browse files Browse the repository at this point in the history
  • Loading branch information
b-naber committed Feb 4, 2021
1 parent 6a68966 commit 9e92015
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions compiler/rustc_trait_selection/src/traits/object_safety.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,11 @@ fn predicates_reference_self(
}

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)
.in_definition_order()
.filter(|item| item.kind == ty::AssocKind::Type)
.flat_map(|item| tcx.explicit_item_bounds(item.def_id))
.map(|&(predicate, sp)| (predicate.subst_supertrait(tcx, &trait_ref), sp))
.filter_map(|predicate| predicate_references_self(tcx, predicate))
.filter_map(|pred_span| predicate_references_self(tcx, *pred_span))
.collect()
}

Expand Down

0 comments on commit 9e92015

Please sign in to comment.