]> git.lizzy.rs Git - rust.git/commitdiff
Move implementation of UnifyKey to unify_key.rs.
authorCamille GILLOT <gillot.camille@gmail.com>
Wed, 22 Jan 2020 12:39:53 +0000 (13:39 +0100)
committerCamille GILLOT <gillot.camille@gmail.com>
Wed, 5 Feb 2020 07:48:09 +0000 (08:48 +0100)
src/librustc/infer/type_variable.rs
src/librustc/infer/unify_key.rs

index 8ea1b705d443d6fb19084345603c2670a8379233..f391a054a2a5dd1cebb852da55fa06a0eb4e3d20 100644 (file)
@@ -453,18 +453,3 @@ fn unify_values(value1: &Self, value2: &Self) -> Result<Self, ut::NoError> {
         }
     }
 }
-
-/// Raw `TyVid` are used as the unification key for `sub_relations`;
-/// they carry no values.
-impl ut::UnifyKey for ty::TyVid {
-    type Value = ();
-    fn index(&self) -> u32 {
-        self.index
-    }
-    fn from_index(i: u32) -> ty::TyVid {
-        ty::TyVid { index: i }
-    }
-    fn tag() -> &'static str {
-        "TyVid"
-    }
-}
index c5ec0ba73e49db186af857602c4f53af88c0f99d..d88188538fccb6998b99fb72dafdea71f2002ecd 100644 (file)
@@ -12,6 +12,21 @@ pub trait ToType {
     fn to_type<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>;
 }
 
+/// Raw `TyVid` are used as the unification key for `sub_relations`;
+/// they carry no values.
+impl UnifyKey for ty::TyVid {
+    type Value = ();
+    fn index(&self) -> u32 {
+        self.index
+    }
+    fn from_index(i: u32) -> ty::TyVid {
+        ty::TyVid { index: i }
+    }
+    fn tag() -> &'static str {
+        "TyVid"
+    }
+}
+
 impl UnifyKey for ty::IntVid {
     type Value = Option<IntVarValue>;
     fn index(&self) -> u32 {