From 75895f59b0742126a7b5abeb86b35df2dfa8ee59 Mon Sep 17 00:00:00 2001 From: yukang Date: Wed, 15 May 2024 10:26:07 +0800 Subject: Fix the dedup error because of spans from suggestion --- compiler/rustc_errors/src/diagnostic.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_errors/src') diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index 1610135a0ef..18bb71bd99f 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -896,7 +896,7 @@ impl<'a, G: EmissionGuarantee> Diag<'a, G> { style: SuggestionStyle, ) -> &mut Self { suggestion.sort_unstable(); - suggestion.dedup(); + suggestion.dedup_by(|(s1, m1), (s2, m2)| s1.source_equal(*s2) && m1 == m2); let parts = suggestion .into_iter() -- cgit 1.4.1-3-g733a5