1
Fork 0

Add bound_explicit_item_bounds and bound_item_bounds

This commit is contained in:
Jack Huey 2022-05-10 22:28:50 -04:00
parent 0247faed29
commit 91afd02632
11 changed files with 120 additions and 76 deletions

View file

@ -604,6 +604,20 @@ impl<'tcx> TyCtxt<'tcx> {
pub fn bound_impl_trait_ref(self, def_id: DefId) -> Option<EarlyBinder<ty::TraitRef<'tcx>>> {
self.impl_trait_ref(def_id).map(|i| EarlyBinder(i))
}
pub fn bound_explicit_item_bounds(
self,
def_id: DefId,
) -> EarlyBinder<&'tcx [(ty::Predicate<'tcx>, rustc_span::Span)]> {
EarlyBinder(self.explicit_item_bounds(def_id))
}
pub fn bound_item_bounds(
self,
def_id: DefId,
) -> EarlyBinder<&'tcx ty::List<ty::Predicate<'tcx>>> {
EarlyBinder(self.item_bounds(def_id))
}
}
struct OpaqueTypeExpander<'tcx> {