introduce a Coerce predicate
This commit is contained in:
committed by
Mark Rousskov
parent
5a8edc0b76
commit
947c0de028
@@ -179,6 +179,7 @@ impl fmt::Debug for ty::PredicateKind<'tcx> {
|
||||
match *self {
|
||||
ty::PredicateKind::Trait(ref a) => a.fmt(f),
|
||||
ty::PredicateKind::Subtype(ref pair) => pair.fmt(f),
|
||||
ty::PredicateKind::Coerce(ref pair) => pair.fmt(f),
|
||||
ty::PredicateKind::RegionOutlives(ref pair) => pair.fmt(f),
|
||||
ty::PredicateKind::TypeOutlives(ref pair) => pair.fmt(f),
|
||||
ty::PredicateKind::Projection(ref pair) => pair.fmt(f),
|
||||
@@ -380,6 +381,13 @@ impl<'a, 'tcx> Lift<'tcx> for ty::SubtypePredicate<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::CoercePredicate<'a> {
|
||||
type Lifted = ty::CoercePredicate<'tcx>;
|
||||
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<ty::CoercePredicate<'tcx>> {
|
||||
tcx.lift((self.a, self.b)).map(|(a, b)| ty::CoercePredicate { a, b })
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx, A: Copy + Lift<'tcx>, B: Copy + Lift<'tcx>> Lift<'tcx> for ty::OutlivesPredicate<A, B> {
|
||||
type Lifted = ty::OutlivesPredicate<A::Lifted, B::Lifted>;
|
||||
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
|
||||
@@ -420,6 +428,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::PredicateKind<'a> {
|
||||
match self {
|
||||
ty::PredicateKind::Trait(data) => tcx.lift(data).map(ty::PredicateKind::Trait),
|
||||
ty::PredicateKind::Subtype(data) => tcx.lift(data).map(ty::PredicateKind::Subtype),
|
||||
ty::PredicateKind::Coerce(data) => tcx.lift(data).map(ty::PredicateKind::Coerce),
|
||||
ty::PredicateKind::RegionOutlives(data) => {
|
||||
tcx.lift(data).map(ty::PredicateKind::RegionOutlives)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user