about summary refs log tree commit diff
path: root/src/tools/rustfmt
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-02-02 23:15:58 +0000
committerbors <bors@rust-lang.org>2025-02-02 23:15:58 +0000
commit613bdd49978298648ed05ace086bd1ecad54b44a (patch)
tree3725056656c352d9ce7ae60a63882868a3d6d104 /src/tools/rustfmt
parent4a43094662727040d8522163f295b19d1aed0e49 (diff)
parenta8055f944fb99a2d53b444b317d85ff9acbb5562 (diff)
Auto merge of #136454 - matthiaskrgr:rollup-ewejzmp, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #136145 (Test validity of pattern types)
 - #136339 (CompileTest: Add Directives to Ignore `arm-unknown-*` Targets)
 - #136403 (Fix malformed error annotations in a UI test)
 - #136414 (Shorten error message for callable with wrong return type)
 - #136425 (Move `rustc_middle::infer::unify_key`)
 - #136426 (Explain why we retroactively change a static initializer to have a different type)
 - #136445 (Couple of cleanups to DiagCtxt and EarlyDiagCtxt)
 - #136452 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/tools/rustfmt')
-rw-r--r--src/tools/rustfmt/src/parse/session.rs16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/tools/rustfmt/src/parse/session.rs b/src/tools/rustfmt/src/parse/session.rs
index 63cc8794cea..34077c5f866 100644
--- a/src/tools/rustfmt/src/parse/session.rs
+++ b/src/tools/rustfmt/src/parse/session.rs
@@ -114,14 +114,13 @@ fn default_dcx(
         false,
     );
     let emitter = Box::new(
-        HumanEmitter::new(stderr_destination(emit_color), fallback_bundle.clone())
+        HumanEmitter::new(stderr_destination(emit_color), fallback_bundle)
             .sm(Some(source_map.clone())),
     );
 
     let emitter: Box<DynEmitter> = if !show_parse_errors {
         Box::new(SilentEmitter {
-            fallback_bundle,
-            fatal_dcx: DiagCtxt::new(emitter),
+            fatal_emitter: emitter,
             fatal_note: None,
             emit_fatal_diagnostic: false,
         })
@@ -205,16 +204,7 @@ impl ParseSess {
     }
 
     pub(crate) fn set_silent_emitter(&mut self) {
-        // Ideally this invocation wouldn't be necessary and the fallback bundle in
-        // `self.parse_sess.dcx` could be used, but the lock in `DiagCtxt` prevents this.
-        // See `<rustc_errors::SilentEmitter as Translate>::fallback_fluent_bundle`.
-        let fallback_bundle = rustc_errors::fallback_fluent_bundle(
-            rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(),
-            false,
-        );
-        self.raw_psess
-            .dcx()
-            .make_silent(fallback_bundle, None, false);
+        self.raw_psess.dcx().make_silent(None, false);
     }
 
     pub(crate) fn span_to_filename(&self, span: Span) -> FileName {