Skip to content

Commit 74a8df6

Browse files
committed
Auto merge of #124398 - klensy:trailing-ws, r=compiler-errors
tests: remove some trailing ws Cleans one more case of trailing whitespace in tests.
2 parents 7823bf0 + ce48c60 commit 74a8df6

24 files changed

+66
-56
lines changed

Diff for: compiler/rustc_errors/src/emitter.rs

+13-3
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ impl HumanEmitter {
984984
// 4 | }
985985
// |
986986
for pos in 0..=line_len {
987-
draw_col_separator(buffer, line_offset + pos + 1, width_offset - 2);
987+
draw_col_separator_no_space(buffer, line_offset + pos + 1, width_offset - 2);
988988
}
989989

990990
// Write the horizontal lines for multiline annotations
@@ -2260,13 +2260,23 @@ impl HumanEmitter {
22602260
buffer.puts(*row_num, max_line_num_len + 1, "+ ", Style::Addition);
22612261
}
22622262
[] => {
2263-
draw_col_separator(buffer, *row_num, max_line_num_len + 1);
2263+
draw_col_separator_no_space(buffer, *row_num, max_line_num_len + 1);
22642264
}
22652265
_ => {
22662266
buffer.puts(*row_num, max_line_num_len + 1, "~ ", Style::Addition);
22672267
}
22682268
}
2269-
buffer.append(*row_num, &normalize_whitespace(line_to_add), Style::NoStyle);
2269+
// LL | line_to_add
2270+
// ++^^^
2271+
// | |
2272+
// | magic `3`
2273+
// `max_line_num_len`
2274+
buffer.puts(
2275+
*row_num,
2276+
max_line_num_len + 3,
2277+
&normalize_whitespace(line_to_add),
2278+
Style::NoStyle,
2279+
);
22702280
} else if let DisplaySuggestion::Add = show_code_change {
22712281
buffer.puts(*row_num, 0, &self.maybe_anonymized(line_num), Style::LineNumber);
22722282
buffer.puts(*row_num, max_line_num_len + 1, "+ ", Style::Addition);

Diff for: src/tools/clippy/tests/ui/from_over_into.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ help: replace the `Into` implementation with `From<ExplicitPaths>`
5454
LL ~ impl core::convert::From<crate::ExplicitPaths> for bool {
5555
LL ~ fn from(mut val: crate::ExplicitPaths) -> Self {
5656
LL ~ let in_closure = || val.0;
57-
LL |
57+
LL |
5858
LL ~ val.0 = false;
5959
LL ~ val.0
6060
|

Diff for: src/tools/clippy/tests/ui/let_and_return.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ LL | result
7171
help: return the expression directly
7272
|
7373
LL ~
74-
LL |
74+
LL |
7575
LL ~ (match self {
7676
LL + E::A(x) => x,
7777
LL + E::B(x) => x,

Diff for: src/tools/clippy/tests/ui/manual_strip.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LL ~ if let Some(<stripped>) = s.strip_prefix("ab") {
1717
LL ~ str::to_string(<stripped>);
1818
LL |
1919
LL ~ <stripped>.to_string();
20-
LL |
20+
LL |
2121
LL ~ str::to_string(<stripped>);
2222
LL ~ <stripped>.to_string();
2323
|
@@ -39,7 +39,7 @@ LL ~ if let Some(<stripped>) = s.strip_suffix("bc") {
3939
LL ~ str::to_string(<stripped>);
4040
LL |
4141
LL ~ <stripped>.to_string();
42-
LL |
42+
LL |
4343
LL ~ str::to_string(<stripped>);
4444
LL ~ <stripped>.to_string();
4545
|

Diff for: src/tools/clippy/tests/ui/result_map_unit_fn_unfixable.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ LL | || do_nothing(value)
2727
LL | || });
2828
| ||______^- help: try: `if let Ok(value) = x.field { ... }`
2929
| |______|
30-
|
30+
|
3131

3232
error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
3333
--> tests/ui/result_map_unit_fn_unfixable.rs:37:5

Diff for: src/tools/clippy/tests/ui/suspicious_doc_comments.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ LL | | ///! b
8585
help: use an inner doc comment to document the parent module or crate
8686
|
8787
LL ~ //! a
88-
LL |
88+
LL |
8989
LL ~ //! b
9090
|
9191

Diff for: tests/ui/codemap_tests/huge_multispan_highlight.svg

+10-10
Loading

Diff for: tests/ui/error-emitter/highlighting.svg

+5-5
Loading

Diff for: tests/ui/error-emitter/highlighting.windows.svg

+5-5
Loading

0 commit comments

Comments
 (0)