diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-02-02 23:06:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-02 23:06:57 +0100 |
| commit | f1bdf3ba4a43bc6adf2e44c8e6a16eb674c563d3 (patch) | |
| tree | 46e6753ad0a79c43572d741a5c8e332ce87d6c05 /src/tools/rustfmt | |
| parent | f5ae630f10d16630e673c3fb9f525a17f09a79eb (diff) | |
| parent | 6a566ee092cacf6e4b327e7fdbbb1003a514b820 (diff) | |
Rollup merge of #136445 - bjorn3:diag_ctxt_cleanup, r=oli-obk
Couple of cleanups to DiagCtxt and EarlyDiagCtxt
Diffstat (limited to 'src/tools/rustfmt')
| -rw-r--r-- | src/tools/rustfmt/src/parse/session.rs | 16 |
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 { |
