Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 87d713f

Browse files
committedAug 4, 2021
Auto merge of #86197 - FabianWolff:trailing-whitespace, r=JohnTitor
Remove unnecessary trailing whitespace from error messages Some error messages currently contain unnecessary trailing whitespace. There are some legitimate reasons for having trailing whitespace in the output, such as for uniform indentation of possibly-empty input lines, but the whitespace I have addressed here occurs in a line used only for spacing, and I see no reason why that should have trailing whitespace (spacing lines inserted in other places also don't have trailing whitespace). I have also removed a superfluous call to `buffer.putc()`, which has no effect because the same character is already placed there by `draw_col_separator()`. Use `git diff --ignore-space-at-eol` to see my changes; otherwise the diff is quite large due to the whitespace removed from expected outputs in `src/test/ui/`.
2 parents 49ca3d9 + f8372f8 commit 87d713f

File tree

125 files changed

+247
-244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+247
-244
lines changed
 

‎compiler/rustc_errors/src/emitter.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,6 @@ impl EmitterWriter {
954954
// |
955955
for pos in 0..=line_len {
956956
draw_col_separator(buffer, line_offset + pos + 1, width_offset - 2);
957-
buffer.putc(line_offset + pos + 1, width_offset - 2, '|', Style::LineNumber);
958957
}
959958

960959
// Write the horizontal lines for multiline annotations
@@ -1344,7 +1343,11 @@ impl EmitterWriter {
13441343
let buffer_msg_line_offset = buffer.num_lines();
13451344

13461345
// Add spacing line
1347-
draw_col_separator(&mut buffer, buffer_msg_line_offset, max_line_num_len + 1);
1346+
draw_col_separator_no_space(
1347+
&mut buffer,
1348+
buffer_msg_line_offset,
1349+
max_line_num_len + 1,
1350+
);
13481351

13491352
// Then, the secondary file indicator
13501353
buffer.prepend(buffer_msg_line_offset + 1, "::: ", Style::LineNumber);

‎src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ error[E0277]: `<<Self as Case1>::C as Iterator>::Item` cannot be sent between th
33
|
44
LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8, App: Debug>> + Sync>;
55
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be sent between threads safely
6-
|
6+
|
77
::: $SRC_DIR/core/src/marker.rs:LL:COL
88
|
99
LL | pub unsafe auto trait Send {
@@ -20,7 +20,7 @@ error[E0277]: `<<Self as Case1>::C as Iterator>::Item` is not an iterator
2020
|
2121
LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8, App: Debug>> + Sync>;
2222
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `<<Self as Case1>::C as Iterator>::Item` is not an iterator
23-
|
23+
|
2424
::: $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
2525
|
2626
LL | pub trait Iterator {
@@ -37,7 +37,7 @@ error[E0277]: `<<Self as Case1>::C as Iterator>::Item` cannot be shared between
3737
|
3838
LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8, App: Debug>> + Sync>;
3939
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely
40-
|
40+
|
4141
::: $SRC_DIR/core/src/marker.rs:LL:COL
4242
|
4343
LL | pub unsafe auto trait Sync {

0 commit comments

Comments
 (0)
Please sign in to comment.