diff options
| author | Jesper Steen Møller <jesper@selskabet.org> | 2019-05-02 15:08:03 +0200 |
|---|---|---|
| committer | Jesper Steen Møller <jesper@selskabet.org> | 2019-05-04 20:29:35 +0200 |
| commit | 6802082039285bc07736f8c9900a0410b5c1e7dc (patch) | |
| tree | 69e14b8a504df4482de1f78eb9fd99192b2c3fbc /src/librustc_data_structures | |
| parent | fc34d5f608e3476bc7c5c4127d4e1ad1ab4fd01a (diff) | |
| download | rust-6802082039285bc07736f8c9900a0410b5c1e7dc.tar.gz rust-6802082039285bc07736f8c9900a0410b5c1e7dc.zip | |
Hash all of the import_ids for the TraitCandidate.
Diffstat (limited to 'src/librustc_data_structures')
| -rw-r--r-- | src/librustc_data_structures/stable_hasher.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/librustc_data_structures/stable_hasher.rs b/src/librustc_data_structures/stable_hasher.rs index 19343a9250d..c777f1fa829 100644 --- a/src/librustc_data_structures/stable_hasher.rs +++ b/src/librustc_data_structures/stable_hasher.rs @@ -1,6 +1,7 @@ use std::hash::{Hash, Hasher, BuildHasher}; use std::marker::PhantomData; use std::mem; +use smallvec::SmallVec; use crate::sip128::SipHasher128; use crate::indexed_vec; use crate::bit_set; @@ -318,6 +319,17 @@ impl<T: HashStable<CTX>, CTX> HashStable<CTX> for Vec<T> { } } +impl<A, CTX> HashStable<CTX> for SmallVec<[A; 1]> where A: HashStable<CTX> { + #[inline] + fn hash_stable<W: StableHasherResult>(&self, + ctx: &mut CTX, + hasher: &mut StableHasher<W>) { + for item in self { + item.hash_stable(ctx, hasher); + } + } +} + impl<T: ?Sized + HashStable<CTX>, CTX> HashStable<CTX> for Box<T> { #[inline] fn hash_stable<W: StableHasherResult>(&self, |
