diff --git a/compiler/rustc_data_structures/src/stable_hasher.rs b/compiler/rustc_data_structures/src/stable_hasher.rs index c2218b92a44..150c835c236 100644 --- a/compiler/rustc_data_structures/src/stable_hasher.rs +++ b/compiler/rustc_data_structures/src/stable_hasher.rs @@ -503,7 +503,7 @@ impl_stable_hash_via_hash!(::std::path::PathBuf); impl HashStable for ::std::collections::HashMap where - K: ToStableHashKey + Eq, + K: HashStable + ToStableHashKey + Eq, V: HashStable, R: BuildHasher, { @@ -555,7 +555,7 @@ pub fn hash_stable_hashmap( map: &::std::collections::HashMap, to_stable_hash_key: F, ) where - K: Eq, + K: Eq + HashStable, V: HashStable, R: BuildHasher, SK: HashStable + Ord, @@ -570,7 +570,7 @@ pub fn hash_stable_hashmap( value.hash_stable(hcx, &mut hasher); hasher.finish::() }) - .reduce(|accum, value| accum.wrapping_mul(value)); + .reduce(|accum, value| accum.wrapping_add(value)); map.len().hash_stable(hcx, hasher); hash.hash_stable(hcx, hasher); }