Uplift TermKind
This commit is contained in:
parent
b0f1afd1fc
commit
9fa07a4e55
5 changed files with 41 additions and 20 deletions
|
@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue