1
Fork 0

Uplift TermKind

This commit is contained in:
Michael Goulet 2024-05-19 13:44:50 -04:00
parent b0f1afd1fc
commit 9fa07a4e55
5 changed files with 41 additions and 20 deletions

View file

@ -371,13 +371,10 @@ impl<'tcx, T: Lift<TyCtxt<'tcx>>> Lift<TyCtxt<'tcx>> for Option<T> {
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for Term<'a> {
type Lifted = ty::Term<'tcx>;
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
Some(
match self.unpack() {
TermKind::Ty(ty) => TermKind::Ty(tcx.lift(ty)?),
TermKind::Const(c) => TermKind::Const(tcx.lift(c)?),
}
.pack(),
)
match self.unpack() {
TermKind::Ty(ty) => tcx.lift(ty).map(Into::into),
TermKind::Const(c) => tcx.lift(c).map(Into::into),
}
}
}