change item_bounds query to return EarlyBinder; remove bound_item_bounds query

This commit is contained in:
Kyle Matsuda 2023-01-16 15:07:23 -07:00
parent 85eeaa9965
commit fc942eed7f
9 changed files with 15 additions and 19 deletions

View file

@ -99,12 +99,16 @@ pub(super) fn explicit_item_bounds(
}
}
pub(super) fn item_bounds(tcx: TyCtxt<'_>, def_id: DefId) -> &'_ ty::List<ty::Predicate<'_>> {
tcx.mk_predicates(
pub(super) fn item_bounds(
tcx: TyCtxt<'_>,
def_id: DefId,
) -> ty::EarlyBinder<&'_ ty::List<ty::Predicate<'_>>> {
let bounds = tcx.mk_predicates(
util::elaborate_predicates(
tcx,
tcx.explicit_item_bounds(def_id).iter().map(|&(bound, _span)| bound),
)
.map(|obligation| obligation.predicate),
)
);
ty::EarlyBinder(bounds)
}