diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-07-16 19:53:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-16 19:53:59 +0200 |
| commit | 8273567a710df78dac143c2500a69ecc37fe5468 (patch) | |
| tree | d928fec67f99f91ea63a25ffbde7ab2e1c63eee7 /compiler/rustc_data_structures/src | |
| parent | 2119976c492894b72287f08865c71d63cff8d471 (diff) | |
| parent | 587e8fd11267911599322878fb37c8d185738c9b (diff) | |
| download | rust-8273567a710df78dac143c2500a69ecc37fe5468.tar.gz rust-8273567a710df78dac143c2500a69ecc37fe5468.zip | |
Rollup merge of #87107 - oli-obk:tait_double, r=nikomatsakis
Loop over all opaque types instead of looking at just the first one with the same DefId This exposed a bug in VecMap and is needed for https://github.com/rust-lang/rust/pull/86410 anyway r? ``@spastorino`` cc ``@nikomatsakis``
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) { |
