Replace tabs in err messages before rendering

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

Fixes #83638
This commit is contained in:
Ömer Sinan Ağacan 2021-03-29 12:24:18 +03:00
parent cc4103089f
commit 8d7432af7b
3 changed files with 15 additions and 1 deletions

View File

@ -1258,7 +1258,7 @@ fn emit_message_default(
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);
}
}

View File

@ -0,0 +1,6 @@
// check-fail
// ignore-tidy-tab
fn main() {
""" " //~ ERROR
}

View File

@ -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