diff options
| author | Jubilee <46493976+workingjubilee@users.noreply.github.com> | 2021-10-04 13:58:11 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-04 13:58:11 -0700 |
| commit | e1478d650d0fdecfb72a341f319efb07bb03265d (patch) | |
| tree | 2054259ceef36500553d6a5d0b7a5192c7711901 /library/alloc/src | |
| parent | 9381d7a898553d34c883c004c798030ce7fd3bd6 (diff) | |
| parent | d6fde80cb4a769af72a5e50c8742c676627f24df (diff) | |
| download | rust-e1478d650d0fdecfb72a341f319efb07bb03265d.tar.gz rust-e1478d650d0fdecfb72a341f319efb07bb03265d.zip | |
Rollup merge of #89443 - cuviper:btree-hash-len, r=dtolnay
Include the length in BTree hashes This change makes it consistent with `Hash` for all other collections.
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/collections/btree/map.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index 11b0ca4b421..d6032372168 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -1968,6 +1968,7 @@ impl<'a, K: Ord + Copy, V: Copy> Extend<(&'a K, &'a V)> for BTreeMap<K, V> { #[stable(feature = "rust1", since = "1.0.0")] impl<K: Hash, V: Hash> Hash for BTreeMap<K, V> { fn hash<H: Hasher>(&self, state: &mut H) { + self.len().hash(state); for elt in self { elt.hash(state); } |
