From 8aaf4ab59aacdc910ea132dbb13a67c8d69a1607 Mon Sep 17 00:00:00 2001 From: Tomasz Miąsko Date: Wed, 13 Oct 2021 00:00:00 +0000 Subject: Deduplicate regions ids before merging them The merging code does not expect to see any duplicates. --- compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'compiler') 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::>(); // 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 -- cgit 1.4.1-3-g733a5