about summary refs log tree commit diff
path: root/src/librustc/infer
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-10-08 07:17:36 -0400
committerNiko Matsakis <niko@alum.mit.edu>2018-10-15 11:42:07 -0400
commit05f67ca1a27a9e69cd99d540a0241759b83cc1bd (patch)
tree22604c02aafae4ac00de9c8ba9c99e9370e8a308 /src/librustc/infer
parentf4190778119383fa15758030cbf038e276a095f6 (diff)
downloadrust-05f67ca1a27a9e69cd99d540a0241759b83cc1bd.tar.gz
rust-05f67ca1a27a9e69cd99d540a0241759b83cc1bd.zip
remove the sub/super terminology for universes
Instead, we talk about:

- creating the "next" universe
- universes "extending" one another
- and `u1.can_name(u2)`, meaning that `u1` contains all names from `u2`
Diffstat (limited to 'src/librustc/infer')
-rw-r--r--src/librustc/infer/higher_ranked/mod.rs4
-rw-r--r--src/librustc/infer/mod.rs11
2 files changed, 6 insertions, 9 deletions
diff --git a/src/librustc/infer/higher_ranked/mod.rs b/src/librustc/infer/higher_ranked/mod.rs
index 884aa956556..ae1892caa74 100644
--- a/src/librustc/infer/higher_ranked/mod.rs
+++ b/src/librustc/infer/higher_ranked/mod.rs
@@ -593,11 +593,11 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
     where
         T : TypeFoldable<'tcx>,
     {
-        let new_universe = self.create_superuniverse();
+        let next_universe = self.create_next_universe();
 
         let (result, map) = self.tcx.replace_late_bound_regions(binder, |br| {
             self.tcx.mk_region(ty::RePlaceholder(ty::Placeholder {
-                universe: new_universe,
+                universe: next_universe,
                 name: br,
             }))
         });
diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs
index 95ecec7d0d5..ef9886e06d4 100644
--- a/src/librustc/infer/mod.rs
+++ b/src/librustc/infer/mod.rs
@@ -1489,13 +1489,10 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
         self.universe.get()
     }
 
-    /// Create and return a new subunivese of the current universe;
-    /// update `self.universe` to that new universe. At present,
-    /// used only in the NLL subtyping code, which uses the new
-    /// universe-based scheme instead of the more limited leak-check
-    /// scheme.
-    pub fn create_superuniverse(&self) -> ty::UniverseIndex {
-        let u = self.universe.get().superuniverse();
+    /// Create and return a fresh universe that extends all previous
+    /// universes. Updates `self.universe` to that new universe.
+    pub fn create_next_universe(&self) -> ty::UniverseIndex {
+        let u = self.universe.get().next_universe();
         self.universe.set(u);
         u
     }