about summary refs log tree commit diff
path: root/compiler/rustc_macros/src/diagnostics/fluent.rs
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2023-03-31 03:48:35 +0200
committerest31 <MTest31@outlook.com>2023-03-31 03:49:21 +0200
commit97fb15d9508da0712aa6a5b194251e90315105fb (patch)
tree2bcf887bda9a1098321204496aff46211e2f70fb /compiler/rustc_macros/src/diagnostics/fluent.rs
parentf24983222d207096851344f7551f0f4ec5cc2a61 (diff)
downloadrust-97fb15d9508da0712aa6a5b194251e90315105fb.tar.gz
rust-97fb15d9508da0712aa6a5b194251e90315105fb.zip
Don't emit the OS error in a note
This makes it possible to make the normalization of the error message
more precise, allowing us to not normalize all notes away.
Diffstat (limited to 'compiler/rustc_macros/src/diagnostics/fluent.rs')
-rw-r--r--compiler/rustc_macros/src/diagnostics/fluent.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/rustc_macros/src/diagnostics/fluent.rs b/compiler/rustc_macros/src/diagnostics/fluent.rs
index 42a1fc147f7..9f96a041487 100644
--- a/compiler/rustc_macros/src/diagnostics/fluent.rs
+++ b/compiler/rustc_macros/src/diagnostics/fluent.rs
@@ -97,9 +97,12 @@ pub(crate) fn fluent_messages(input: proc_macro::TokenStream) -> proc_macro::Tok
     let resource_contents = match read_to_string(absolute_ftl_path) {
         Ok(resource_contents) => resource_contents,
         Err(e) => {
-            Diagnostic::spanned(resource_span, Level::Error, "could not open Fluent resource")
-                .note(e.to_string())
-                .emit();
+            Diagnostic::spanned(
+                resource_span,
+                Level::Error,
+                format!("could not open Fluent resource: {}", e.to_string()),
+            )
+            .emit();
             return failed(&crate_name);
         }
     };