about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-04 10:02:57 +0000
committerbors <bors@rust-lang.org>2023-09-04 10:02:57 +0000
commitbf1e3f31f95c0f75b9bf51a58e8684f750f919f2 (patch)
tree6d8341fe231b58979e7d94b24131c04ce5c45783 /compiler/rustc_errors/src
parentce798a52c30528366764a5993783b4e9ccfa46ee (diff)
parentec0975dd6bdd2afb2cbe3373ba3da98ec8ef453b (diff)
downloadrust-bf1e3f31f95c0f75b9bf51a58e8684f750f919f2.tar.gz
rust-bf1e3f31f95c0f75b9bf51a58e8684f750f919f2.zip
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
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/emitter.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs
index 1811738c011..da108327ae7 100644
--- a/compiler/rustc_errors/src/emitter.rs
+++ b/compiler/rustc_errors/src/emitter.rs
@@ -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 {