about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorScott Schafer <schaferjscott@gmail.com>2025-07-01 19:09:45 -0600
committerScott Schafer <schaferjscott@gmail.com>2025-07-10 08:00:20 -0600
commitd67bf6095a9a3f278a223a20b316c235360c1c90 (patch)
tree801e27abcc1c5d3ffaf928abe42aaa990fbac9c3 /compiler/rustc_errors/src
parent61b172a34c94108d013a2d352901b4a5a06ad9ee (diff)
downloadrust-d67bf6095a9a3f278a223a20b316c235360c1c90.tar.gz
rust-d67bf6095a9a3f278a223a20b316c235360c1c90.zip
chore: Improve how the other suggestions message gets rendered
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/emitter.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs
index 2f398cea926..1b581f93736 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)?;