Skip to content

Commit

Permalink
use stable sort to sort multipart diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Aug 8, 2024
1 parent 9337f7a commit d1dc694
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ impl<'a, G: EmissionGuarantee> Diag<'a, G> {
applicability: Applicability,
style: SuggestionStyle,
) -> &mut Self {
suggestion.sort_unstable();
suggestion.sort_by_key(|(span, _)| *span);
suggestion.dedup_by(|(s1, m1), (s2, m2)| s1.source_equal(*s2) && m1 == m2);

let parts = suggestion
Expand Down

0 comments on commit d1dc694

Please sign in to comment.