diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-12-28 12:55:26 +0100 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-01-01 20:05:48 +0100 |
| commit | e42b21b522033dfd3a2807e20e789a94830ec346 (patch) | |
| tree | cde141d796a00f1ee26f0cc0f414f9cda8ef73ec | |
| parent | 48aa81911ceafbddfe1db90ec287aafa31047576 (diff) | |
| download | rust-e42b21b522033dfd3a2807e20e789a94830ec346.tar.gz rust-e42b21b522033dfd3a2807e20e789a94830ec346.zip | |
Properly lift `Allocations`
| -rw-r--r-- | src/librustc/ty/context.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index dfeab9715cc..8ecaa42a2e9 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -1811,15 +1811,8 @@ impl<'a, 'tcx> Lift<'tcx> for &'a LazyConst<'a> { impl<'a, 'tcx> Lift<'tcx> for &'a mir::interpret::Allocation { type Lifted = &'tcx mir::interpret::Allocation; fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'b, 'gcx, 'tcx>) -> Option<Self::Lifted> { - if tcx.interners.arena.in_arena(*self as *const _) { - return Some(unsafe { mem::transmute(*self) }); - } - // Also try in the global tcx if we're not that. - if !tcx.is_global() { - self.lift_to_tcx(tcx.global_tcx()) - } else { - None - } + assert!(tcx.global_interners.arena.in_arena(*self as *const _)); + Some(unsafe { mem::transmute(*self) }) } } |
