diff options
| author | Oli Scherer <github35764891676564198441@oli-obk.de> | 2021-07-13 15:05:29 +0000 |
|---|---|---|
| committer | Oli Scherer <github35764891676564198441@oli-obk.de> | 2021-07-13 15:05:29 +0000 |
| commit | 692f63803683534ca7ff1c0a0a5e15cbfc61db0a (patch) | |
| tree | 78fbc3fc2f5cc567ccb18a0b795148b755f61153 /compiler/rustc_data_structures/src/vec_map.rs | |
| parent | ee86f96ba176f598d64dc9f3bb7e074d5b8b86b6 (diff) | |
| download | rust-692f63803683534ca7ff1c0a0a5e15cbfc61db0a.tar.gz rust-692f63803683534ca7ff1c0a0a5e15cbfc61db0a.zip | |
Fix VecMap Extend impl
Diffstat (limited to 'compiler/rustc_data_structures/src/vec_map.rs')
| -rw-r--r-- | compiler/rustc_data_structures/src/vec_map.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/rustc_data_structures/src/vec_map.rs b/compiler/rustc_data_structures/src/vec_map.rs index 73b04d3329c..1786fa340cc 100644 --- a/compiler/rustc_data_structures/src/vec_map.rs +++ b/compiler/rustc_data_structures/src/vec_map.rs @@ -127,13 +127,15 @@ impl<K, V> IntoIterator for VecMap<K, V> { } } -impl<K, V> Extend<(K, V)> for VecMap<K, V> { +impl<K: PartialEq, V> Extend<(K, V)> for VecMap<K, V> { fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, iter: I) { - self.0.extend(iter); + for (k, v) in iter { + self.insert(k, v); + } } - fn extend_one(&mut self, item: (K, V)) { - self.0.extend_one(item); + fn extend_one(&mut self, (k, v): (K, V)) { + self.insert(k, v); } fn extend_reserve(&mut self, additional: usize) { |
