Auto merge of #115513 - Urgau:normalize-msg-after-translate, r=petrochenkov

Don't forget to normalize the translated message

This PR adds a missing call to `normalize_whitespace` after translating an label.

Fixes https://github.com/rust-lang/rust/issues/115498
This commit is contained in:
bors 2023-09-04 10:02:57 +00:00
commit bf1e3f31f9
3 changed files with 23 additions and 1 deletions

View file

@ -2348,7 +2348,13 @@ impl FileWithAnnotatedLines {
}
let label = label.as_ref().map(|m| {
emitter.translate_message(m, args).map_err(Report::new).unwrap().to_string()
normalize_whitespace(
&emitter
.translate_message(m, &args)
.map_err(Report::new)
.unwrap()
.to_string(),
)
});
if lo.line != hi.line {