about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2023-02-01 17:38:56 +0000
committerEsteban Küber <esteban@kuber.com.ar>2023-02-14 20:22:10 +0000
commit5d63e10318ea76efc4d4d6a33cf1f74c9839adfb (patch)
tree7bac8c472be48675a1b63380f9cb31c43c246c24 /compiler
parent287cd5974c3fc7c885500036ffc8305ac978bede (diff)
downloadrust-5d63e10318ea76efc4d4d6a33cf1f74c9839adfb.tar.gz
rust-5d63e10318ea76efc4d4d6a33cf1f74c9839adfb.zip
rebase and review comments
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_errors/src/diagnostic.rs3
-rw-r--r--compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs2
2 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs
index 5b2786fbb17..9ed8ab67431 100644
--- a/compiler/rustc_errors/src/diagnostic.rs
+++ b/compiler/rustc_errors/src/diagnostic.rs
@@ -612,7 +612,7 @@ impl Diagnostic {
     pub fn multipart_suggestion_with_style(
         &mut self,
         msg: impl Into<SubdiagnosticMessage>,
-        mut suggestion: Vec<(Span, String)>,
+        suggestion: Vec<(Span, String)>,
         applicability: Applicability,
         style: SuggestionStyle,
     ) -> &mut Self {
@@ -634,7 +634,6 @@ impl Diagnostic {
             None,
             "suggestion must not have overlapping parts",
         );
-        suggestion.sort_by_key(|(span, _)| (span.lo(), span.hi()));
 
         self.push_suggestion(CodeSuggestion {
             substitutions: vec![Substitution { parts }],
diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
index af57d1e5120..21f236db7dc 100644
--- a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
+++ b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
@@ -930,7 +930,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                         "".to_string()
                     };
                     labels
-                        .push((provided_span, format!("argument{} unexpected", provided_ty_name)));
+                        .push((provided_span, format!("unexpected argument{}", provided_ty_name)));
                     let mut span = provided_span;
                     if arg_idx.index() > 0
                         && let Some((_, prev)) = provided_arg_tys