Skip to content

Commit e42b21b

Browse files
committed
Properly lift Allocations
1 parent 48aa819 commit e42b21b

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/librustc/ty/context.rs

+2-9
Original file line numberDiff line numberDiff line change
@@ -1811,15 +1811,8 @@ impl<'a, 'tcx> Lift<'tcx> for &'a LazyConst<'a> {
18111811
impl<'a, 'tcx> Lift<'tcx> for &'a mir::interpret::Allocation {
18121812
type Lifted = &'tcx mir::interpret::Allocation;
18131813
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'b, 'gcx, 'tcx>) -> Option<Self::Lifted> {
1814-
if tcx.interners.arena.in_arena(*self as *const _) {
1815-
return Some(unsafe { mem::transmute(*self) });
1816-
}
1817-
// Also try in the global tcx if we're not that.
1818-
if !tcx.is_global() {
1819-
self.lift_to_tcx(tcx.global_tcx())
1820-
} else {
1821-
None
1822-
}
1814+
assert!(tcx.global_interners.arena.in_arena(*self as *const _));
1815+
Some(unsafe { mem::transmute(*self) })
18231816
}
18241817
}
18251818

0 commit comments

Comments
 (0)