Skip to content

Commit

Permalink
Auto merge of #83639 - osa1:issue83638, r=estebank
Browse files Browse the repository at this point in the history
Replace tabs in err messages before rendering

This is done in other call sites, but was missing in one place.

Fixes #83638
  • Loading branch information
bors committed Mar 30, 2021
2 parents 7b6fc5a + 8d7432a commit 926ec1c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ impl EmitterWriter {
buffer.append(0, ": ", header_style);
}
for &(ref text, _) in msg.iter() {
buffer.append(0, text, header_style);
buffer.append(0, &replace_tabs(text), header_style);
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/test/ui/issue-83639.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// check-fail
// ignore-tidy-tab

fn main() {
""" " //~ ERROR
}
8 changes: 8 additions & 0 deletions src/test/ui/issue-83639.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `" "`
--> $DIR/issue-83639.rs:5:7
|
LL | """ "
| ^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator

error: aborting due to previous error

0 comments on commit 926ec1c

Please sign in to comment.