]> git.lizzy.rs Git - rust.git/commitdiff
what is going on?
authorOliver Scherer <github35764891676564198441@oli-obk.de>
Thu, 27 Dec 2018 14:21:47 +0000 (15:21 +0100)
committerOliver Scherer <github35764891676564198441@oli-obk.de>
Tue, 1 Jan 2019 19:05:03 +0000 (20:05 +0100)
src/librustc/ty/context.rs

index ce9be4e84054a17d20112d6f4eabe34ebb3c04b0..dfeab9715cc01dfa5281c7426554297328295d61 100644 (file)
@@ -1730,7 +1730,12 @@ fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'b, 'gcx, 'tcx>) -> Option<Region<'t
         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 @@ fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'b, 'gcx, 'tcx>) -> Option<Goal<'tcx
         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)))
     }
 }