diff options
| author | Ralf Jung <post@ralfj.de> | 2025-07-14 06:06:20 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-14 06:06:20 +0000 |
| commit | 794dc328b46520f145091771db6531bf1d5b5c4e (patch) | |
| tree | 57b04ecd511abfddf715b5605fc0e091a7792d16 /compiler/rustc_errors/src | |
| parent | 91a52cac82ead1d8ed75fa5bd22df228a250bb17 (diff) | |
| parent | 8812d741eb54c58ee1b9bf6bd69e60f08bba941a (diff) | |
| download | rust-794dc328b46520f145091771db6531bf1d5b5c4e.tar.gz rust-794dc328b46520f145091771db6531bf1d5b5c4e.zip | |
Merge pull request #4467 from rust-lang/rustup-2025-07-14
Automatic Rustup
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_errors/src/emitter.rs | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index 5746c28a2ab..a128f8d31a1 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -1165,7 +1165,7 @@ impl<'a, G: EmissionGuarantee> Diag<'a, G> { self.push_suggestion(CodeSuggestion { substitutions, msg: self.subdiagnostic_message_to_diagnostic_message(msg), - style: SuggestionStyle::ShowCode, + style: SuggestionStyle::ShowAlways, applicability, }); self diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index 510f37f37e2..95400ac2ca3 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -2446,17 +2446,22 @@ impl HumanEmitter { | DisplaySuggestion::Underline => row_num - 1, DisplaySuggestion::None => row_num, }; - self.draw_col_separator_end(&mut buffer, row, max_line_num_len + 1); + if other_suggestions > 0 { + self.draw_col_separator_no_space(&mut buffer, row, max_line_num_len + 1); + } else { + self.draw_col_separator_end(&mut buffer, row, max_line_num_len + 1); + } row_num = row + 1; } } if other_suggestions > 0 { + self.draw_note_separator(&mut buffer, row_num, max_line_num_len + 1, false); let msg = format!( "and {} other candidate{}", other_suggestions, pluralize!(other_suggestions) ); - buffer.puts(row_num, max_line_num_len + 3, &msg, Style::NoStyle); + buffer.append(row_num, &msg, Style::NoStyle); } emit_to_destination(&buffer.render(), level, &mut self.dst, self.short_message)?; |
