From 6802082039285bc07736f8c9900a0410b5c1e7dc Mon Sep 17 00:00:00 2001 From: Jesper Steen Møller Date: Thu, 2 May 2019 15:08:03 +0200 Subject: Hash all of the import_ids for the TraitCandidate. --- src/librustc_data_structures/stable_hasher.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/librustc_data_structures') 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, CTX> HashStable for Vec { } } +impl HashStable for SmallVec<[A; 1]> where A: HashStable { + #[inline] + fn hash_stable(&self, + ctx: &mut CTX, + hasher: &mut StableHasher) { + for item in self { + item.hash_stable(ctx, hasher); + } + } +} + impl, CTX> HashStable for Box { #[inline] fn hash_stable(&self, -- cgit 1.4.1-3-g733a5