migrate inferred_outlives_of to Clause

This commit is contained in:
Michael Goulet
2023-06-20 03:25:40 +00:00
parent 2fa796a3c7
commit 471830b3a4
7 changed files with 21 additions and 29 deletions

View File

@@ -731,7 +731,7 @@ pub struct CratePredicatesMap<'tcx> {
/// predicate of its outlive bounds. If an item has no outlives
/// bounds, it will have no entry.
// FIXME(clause): should this be a `Clause`?
pub predicates: FxHashMap<DefId, &'tcx [(ClauseKind<'tcx>, Span)]>,
pub predicates: FxHashMap<DefId, &'tcx [(Clause<'tcx>, Span)]>,
}
impl<'tcx> Predicate<'tcx> {
@@ -1272,6 +1272,13 @@ impl<'tcx> ToPredicate<'tcx> for Clause<'tcx> {
}
}
impl<'tcx> ToPredicate<'tcx, Clause<'tcx>> for ClauseKind<'tcx> {
#[inline(always)]
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Clause<'tcx> {
tcx.mk_predicate(Binder::dummy(ty::PredicateKind::Clause(self))).expect_clause()
}
}
impl<'tcx> ToPredicate<'tcx, Clause<'tcx>> for Binder<'tcx, ClauseKind<'tcx>> {
#[inline(always)]
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Clause<'tcx> {