diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index 633c64af3c5..8ec06feb5bf 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -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); } } diff --git a/src/test/ui/issue-83639.rs b/src/test/ui/issue-83639.rs new file mode 100644 index 00000000000..6ddbedfa0bc --- /dev/null +++ b/src/test/ui/issue-83639.rs @@ -0,0 +1,6 @@ +// check-fail +// ignore-tidy-tab + +fn main() { + """ " //~ ERROR +} diff --git a/src/test/ui/issue-83639.stderr b/src/test/ui/issue-83639.stderr new file mode 100644 index 00000000000..4c10df1917c --- /dev/null +++ b/src/test/ui/issue-83639.stderr @@ -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 +