Move implementation of UnifyKey to unify_key.rs.
This commit is contained in:
parent
005f14d518
commit
b3f13b00f5
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user