diff options
| author | bors <bors@rust-lang.org> | 2024-04-30 00:42:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-30 00:42:32 +0000 |
| commit | 74a8df6c650f6067babf942a77f78e9b9a7fee31 (patch) | |
| tree | 42aeab2415ec0d24d8da560ab3ac568a87a11147 /compiler/rustc_errors/src | |
| parent | 7823bf041257d2fcfce0bca51ab555d66646092e (diff) | |
| parent | ce48c60c99c33f6df9d2fe6c9e943da4be68f370 (diff) | |
| download | rust-74a8df6c650f6067babf942a77f78e9b9a7fee31.tar.gz rust-74a8df6c650f6067babf942a77f78e9b9a7fee31.zip | |
Auto merge of #124398 - klensy:trailing-ws, r=compiler-errors
tests: remove some trailing ws Cleans one more case of trailing whitespace in tests.
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/emitter.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index 6074a4a30bb..0b8be33b405 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -984,7 +984,7 @@ impl HumanEmitter { // 4 | } // | for pos in 0..=line_len { - draw_col_separator(buffer, line_offset + pos + 1, width_offset - 2); + draw_col_separator_no_space(buffer, line_offset + pos + 1, width_offset - 2); } // Write the horizontal lines for multiline annotations @@ -2260,13 +2260,23 @@ impl HumanEmitter { buffer.puts(*row_num, max_line_num_len + 1, "+ ", Style::Addition); } [] => { - draw_col_separator(buffer, *row_num, max_line_num_len + 1); + draw_col_separator_no_space(buffer, *row_num, max_line_num_len + 1); } _ => { buffer.puts(*row_num, max_line_num_len + 1, "~ ", Style::Addition); } } - buffer.append(*row_num, &normalize_whitespace(line_to_add), Style::NoStyle); + // LL | line_to_add + // ++^^^ + // | | + // | magic `3` + // `max_line_num_len` + buffer.puts( + *row_num, + max_line_num_len + 3, + &normalize_whitespace(line_to_add), + Style::NoStyle, + ); } else if let DisplaySuggestion::Add = show_code_change { buffer.puts(*row_num, 0, &self.maybe_anonymized(line_num), Style::LineNumber); buffer.puts(*row_num, max_line_num_len + 1, "+ ", Style::Addition); |
