diff options
| author | bors <bors@rust-lang.org> | 2021-07-16 19:04:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-07-16 19:04:16 +0000 |
| commit | 74ef0c3e404cc72c08b2d1e14506f90d9e877269 (patch) | |
| tree | ee3ec7a9da52443949f2ab252c60bbfcb5a409e2 /compiler/rustc_data_structures/src | |
| parent | c49895d9049f67e07e297ee487836a587f69690e (diff) | |
| parent | 7d36d69b4a0e6606b9a9c077302df7464ac1a4e7 (diff) | |
| download | rust-74ef0c3e404cc72c08b2d1e14506f90d9e877269.tar.gz rust-74ef0c3e404cc72c08b2d1e14506f90d9e877269.zip | |
Auto merge of #87201 - GuillaumeGomez:rollup-4loi2q9, r=GuillaumeGomez
Rollup of 7 pull requests Successful merges: - #87107 (Loop over all opaque types instead of looking at just the first one with the same DefId) - #87158 (Suggest full enum variant for local modules) - #87174 (Stabilize `[T; N]::map()`) - #87179 (Mark `const_trait_impl` as active) - #87180 (feat(rustdoc): open sidebar menu when links inside it are focused) - #87188 (Add GUI test for auto-hide-trait-implementations setting) - #87200 (TAIT: Infer all inference variables in opaque type substitutions via InferCx) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -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) { |
