Fixed to_sorted => to_sorted_stable_ord

This commit is contained in:
Andrew Xie 2023-06-05 00:16:20 -04:00
parent 6f2d3dee17
commit f5f638c124
6 changed files with 60 additions and 37 deletions

View file

@ -339,6 +339,8 @@ impl<T1: HashStable<CTX>, T2: HashStable<CTX>, CTX> HashStable<CTX> for (T1, T2)
}
}
unsafe impl<T1: StableOrd, T2: StableOrd> StableOrd for (T1, T2) {}
impl<T1, T2, T3, CTX> HashStable<CTX> for (T1, T2, T3)
where
T1: HashStable<CTX>,
@ -353,6 +355,8 @@ where
}
}
unsafe impl<T1: StableOrd, T2: StableOrd, T3: StableOrd> StableOrd for (T1, T2, T3) {}
impl<T1, T2, T3, T4, CTX> HashStable<CTX> for (T1, T2, T3, T4)
where
T1: HashStable<CTX>,
@ -369,6 +373,11 @@ where
}
}
unsafe impl<T1: StableOrd, T2: StableOrd, T3: StableOrd, T4: StableOrd> StableOrd
for (T1, T2, T3, T4)
{
}
impl<T: HashStable<CTX>, CTX> HashStable<CTX> for [T] {
default fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
self.len().hash_stable(ctx, hasher);
@ -459,6 +468,8 @@ impl<CTX> HashStable<CTX> for str {
}
}
unsafe impl StableOrd for &str {}
impl<CTX> HashStable<CTX> for String {
#[inline]
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {