From 48aa81911ceafbddfe1db90ec287aafa31047576 Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Thu, 27 Dec 2018 15:21:47 +0100 Subject: [PATCH] what is going on? --- src/librustc/ty/context.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index ce9be4e84054..dfeab9715cc0 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -1730,7 +1730,12 @@ impl<'a, 'tcx> Lift<'tcx> for Region<'a> { if tcx.interners.arena.in_arena(*self as *const _) { return Some(unsafe { mem::transmute(*self) }); } - Some(tcx.intern_const_alloc(mir::interpret::Allocation::clone(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 + } } } @@ -1740,12 +1745,7 @@ impl<'a, 'tcx> Lift<'tcx> for Goal<'a> { 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 - } + Some(tcx.intern_const_alloc(mir::interpret::Allocation::clone(self))) } }