diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-05-11 10:38:54 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-06-01 20:53:04 +0200 |
| commit | 273778086c08dff938af758ae4a1b00974480c5d (patch) | |
| tree | 1235744326cc1e9eda8add423e8b28b9a994b24d /compiler/rustc_data_structures | |
| parent | e291be3649c3088735936a6258317e69d3ad88f0 (diff) | |
| download | rust-273778086c08dff938af758ae4a1b00974480c5d.tar.gz rust-273778086c08dff938af758ae4a1b00974480c5d.zip | |
Remove StableVec.
Diffstat (limited to 'compiler/rustc_data_structures')
| -rw-r--r-- | compiler/rustc_data_structures/src/stable_hasher.rs | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/compiler/rustc_data_structures/src/stable_hasher.rs b/compiler/rustc_data_structures/src/stable_hasher.rs index ff28784a1dc..18b352cf3b0 100644 --- a/compiler/rustc_data_structures/src/stable_hasher.rs +++ b/compiler/rustc_data_structures/src/stable_hasher.rs @@ -550,35 +550,3 @@ pub fn hash_stable_hashmap<HCX, K, V, R, SK, F>( entries.sort_unstable_by(|&(ref sk1, _), &(ref sk2, _)| sk1.cmp(sk2)); entries.hash_stable(hcx, hasher); } - -/// A vector container that makes sure that its items are hashed in a stable -/// order. -#[derive(Debug)] -pub struct StableVec<T>(Vec<T>); - -impl<T> StableVec<T> { - pub fn new(v: Vec<T>) -> Self { - StableVec(v) - } -} - -impl<T> ::std::ops::Deref for StableVec<T> { - type Target = Vec<T>; - - fn deref(&self) -> &Vec<T> { - &self.0 - } -} - -impl<T, HCX> HashStable<HCX> for StableVec<T> -where - T: HashStable<HCX> + ToStableHashKey<HCX>, -{ - fn hash_stable(&self, hcx: &mut HCX, hasher: &mut StableHasher) { - let StableVec(ref v) = *self; - - let mut sorted: Vec<_> = v.iter().map(|x| x.to_stable_hash_key(hcx)).collect(); - sorted.sort_unstable(); - sorted.hash_stable(hcx, hasher); - } -} |
