Make root vars more stable
This commit is contained in:
@@ -238,6 +238,9 @@ impl<'tcx> ut::UnifyKey for TyVidEqKey<'tcx> {
|
||||
fn tag() -> &'static str {
|
||||
"TyVidEqKey"
|
||||
}
|
||||
fn order_roots(a: Self, _: &Self::Value, b: Self, _: &Self::Value) -> Option<(Self, Self)> {
|
||||
if a.vid.as_u32() < b.vid.as_u32() { Some((a, b)) } else { Some((b, a)) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> ut::UnifyValue for TypeVariableValue<'tcx> {
|
||||
|
||||
@@ -137,6 +137,9 @@ impl<'tcx> UnifyKey for ConstVidKey<'tcx> {
|
||||
fn tag() -> &'static str {
|
||||
"ConstVidKey"
|
||||
}
|
||||
fn order_roots(a: Self, _: &Self::Value, b: Self, _: &Self::Value) -> Option<(Self, Self)> {
|
||||
if a.vid.as_u32() < b.vid.as_u32() { Some((a, b)) } else { Some((b, a)) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> UnifyValue for ConstVariableValue<'tcx> {
|
||||
|
||||
Reference in New Issue
Block a user