about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2021-10-13 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2021-10-13 00:00:00 +0000
commit8aaf4ab59aacdc910ea132dbb13a67c8d69a1607 (patch)
tree2f7c492fadb8c67e8b55f8bc143ad2b7eeb8657b /compiler
parent9475e609b8458fff9e444934a6017d2e590642cf (diff)
downloadrust-8aaf4ab59aacdc910ea132dbb13a67c8d69a1607.tar.gz
rust-8aaf4ab59aacdc910ea132dbb13a67c8d69a1607.zip
Deduplicate regions ids before merging them
The merging code does not expect to see any duplicates.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs b/compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs
index 0373035a09a..beacf301cae 100644
--- a/compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs
+++ b/compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs
@@ -192,6 +192,7 @@ impl ItemLikeVisitor<'v> for InherentOverlapChecker<'tcx> {
                             .collect::<SmallVec<[RegionId; 8]>>();
                         // Sort the id list so that the algorithm is deterministic
                         ids.sort_unstable();
+                        ids.dedup();
                         let ids = ids;
                         match &ids[..] {
                             // Create a new connected region