diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2023-11-08 18:24:49 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2023-11-19 17:50:45 +0000 |
| commit | f1ae02f4bd971acc384ed3422e235fb1eb07dfa7 (patch) | |
| tree | 915a591704f55e32991c03b55600a5ba13d7a3a2 /compiler/rustc_errors | |
| parent | 42aa1273b0dd317c4aafdcf649f40cbad4499b60 (diff) | |
| download | rust-f1ae02f4bd971acc384ed3422e235fb1eb07dfa7.tar.gz rust-f1ae02f4bd971acc384ed3422e235fb1eb07dfa7.zip | |
Don't sort `span_suggestions`, leave that to caller
Diffstat (limited to 'compiler/rustc_errors')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index b379d17dc22..1c1da89c557 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -759,9 +759,6 @@ impl Diagnostic { suggestions: impl IntoIterator<Item = String>, applicability: Applicability, ) -> &mut Self { - let mut suggestions: Vec<_> = suggestions.into_iter().collect(); - suggestions.sort(); - self.span_suggestions_with_style( sp, msg, @@ -771,9 +768,7 @@ impl Diagnostic { ) } - /// [`Diagnostic::span_suggestions()`] but you can set the [`SuggestionStyle`]. This version - /// *doesn't* sort the suggestions, so the caller has control of the order in which they are - /// presented. + /// [`Diagnostic::span_suggestions()`] but you can set the [`SuggestionStyle`]. pub fn span_suggestions_with_style( &mut self, sp: Span, |
