1
Fork 0

Rollup merge of #110578 - bvanjoi:fix-issue-110547, r=jackh726

fix(error): normalize whitespace during msg_to_buffer

close https://github.com/rust-lang/rust/issues/110547
This commit is contained in:
Matthias Krüger 2023-04-21 06:44:30 +02:00 committed by GitHub
commit 637d9ddc35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 0 deletions

View file

@ -1336,6 +1336,7 @@ impl EmitterWriter {
// see?
for (text, style) in msg.iter() {
let text = self.translate_message(text, args).map_err(Report::new).unwrap();
let text = &normalize_whitespace(&text);
let lines = text.split('\n').collect::<Vec<_>>();
if lines.len() > 1 {
for (i, line) in lines.iter().enumerate() {