Skip to content

Commit

Permalink
Replace tabs in err messages before rendering
Browse files Browse the repository at this point in the history
This is done in other call sites, but was missing in one place.

Fixes rust-lang#83638
  • Loading branch information
osa1 committed Mar 29, 2021
1 parent cc41030 commit 8d7432a
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 8d7432a

Please sign in to comment.