From b3f13b00f5fadad44efd048c69136d18108e0647 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Wed, 22 Jan 2020 13:39:53 +0100 Subject: [PATCH] Move implementation of UnifyKey to unify_key.rs. --- src/librustc/infer/type_variable.rs | 15 --------------- src/librustc/infer/unify_key.rs | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/librustc/infer/type_variable.rs b/src/librustc/infer/type_variable.rs index 8ea1b705d44..f391a054a2a 100644 --- a/src/librustc/infer/type_variable.rs +++ b/src/librustc/infer/type_variable.rs @@ -453,18 +453,3 @@ impl<'tcx> ut::UnifyValue for TypeVariableValue<'tcx> { } } } - -/// 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" - } -} diff --git a/src/librustc/infer/unify_key.rs b/src/librustc/infer/unify_key.rs index c5ec0ba73e4..d88188538fc 100644 --- a/src/librustc/infer/unify_key.rs +++ b/src/librustc/infer/unify_key.rs @@ -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; fn index(&self) -> u32 {