Skip to content

Commit b3f13b0

Browse files
committed
Move implementation of UnifyKey to unify_key.rs.
1 parent 005f14d commit b3f13b0

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/librustc/infer/type_variable.rs

-15
Original file line numberDiff line numberDiff line change
@@ -453,18 +453,3 @@ impl<'tcx> ut::UnifyValue for TypeVariableValue<'tcx> {
453453
}
454454
}
455455
}
456-
457-
/// Raw `TyVid` are used as the unification key for `sub_relations`;
458-
/// they carry no values.
459-
impl ut::UnifyKey for ty::TyVid {
460-
type Value = ();
461-
fn index(&self) -> u32 {
462-
self.index
463-
}
464-
fn from_index(i: u32) -> ty::TyVid {
465-
ty::TyVid { index: i }
466-
}
467-
fn tag() -> &'static str {
468-
"TyVid"
469-
}
470-
}

src/librustc/infer/unify_key.rs

+15
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@ pub trait ToType {
1212
fn to_type<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>;
1313
}
1414

15+
/// Raw `TyVid` are used as the unification key for `sub_relations`;
16+
/// they carry no values.
17+
impl UnifyKey for ty::TyVid {
18+
type Value = ();
19+
fn index(&self) -> u32 {
20+
self.index
21+
}
22+
fn from_index(i: u32) -> ty::TyVid {
23+
ty::TyVid { index: i }
24+
}
25+
fn tag() -> &'static str {
26+
"TyVid"
27+
}
28+
}
29+
1530
impl UnifyKey for ty::IntVid {
1631
type Value = Option<IntVarValue>;
1732
fn index(&self) -> u32 {

0 commit comments

Comments
 (0)