about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/lib.rs
diff options
context:
space:
mode:
authorCameron Steffen <cam.steffen94@gmail.com>2025-06-19 13:02:04 -0500
committerCameron Steffen <cam.steffen94@gmail.com>2025-06-19 13:02:04 -0500
commit07b9bb1855596ac84a80d898b40c4b403f1dcc3f (patch)
treeddcf02a1bb7f17cdfa8c0b638977c28ca6acef0c /compiler/rustc_errors/src/lib.rs
parent8de4c7234dd9b97c9d76b58671343fdbbc9a433e (diff)
downloadrust-07b9bb1855596ac84a80d898b40c4b403f1dcc3f.tar.gz
rust-07b9bb1855596ac84a80d898b40c4b403f1dcc3f.zip
Extract Translator struct
Diffstat (limited to 'compiler/rustc_errors/src/lib.rs')
-rw-r--r--compiler/rustc_errors/src/lib.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index 0bd259366de..70f294b696a 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -761,14 +761,8 @@ impl DiagCtxt {
             fn source_map(&self) -> Option<&SourceMap> {
                 unimplemented!("false emitter must only used during `make_silent`")
             }
-        }
-
-        impl translation::Translate for FalseEmitter {
-            fn fluent_bundle(&self) -> Option<&FluentBundle> {
-                unimplemented!("false emitter must only used during `make_silent`")
-            }
 
-            fn fallback_fluent_bundle(&self) -> &FluentBundle {
+            fn translator(&self) -> &translation::Translator {
                 unimplemented!("false emitter must only used during `make_silent`")
             }
         }
@@ -1771,7 +1765,12 @@ impl DiagCtxtInner {
         args: impl Iterator<Item = DiagArg<'a>>,
     ) -> String {
         let args = crate::translation::to_fluent_args(args);
-        self.emitter.translate_message(&message, &args).map_err(Report::new).unwrap().to_string()
+        self.emitter
+            .translator()
+            .translate_message(&message, &args)
+            .map_err(Report::new)
+            .unwrap()
+            .to_string()
     }
 
     fn eagerly_translate_for_subdiag(