diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-02-02 15:36:28 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-02-02 16:06:43 +0000 |
| commit | 6556147d15f077dfc88dae22f3983b3598bce465 (patch) | |
| tree | 0ca8b89e687a856423d336ff1c7b41141bc1e216 /src/tools/rustfmt | |
| parent | aa2b870bb59a1eb6af3ee35567291a0f8c8a2828 (diff) | |
Use fallback fluent bundle from inner emitter in SilentEmitter
Diffstat (limited to 'src/tools/rustfmt')
| -rw-r--r-- | src/tools/rustfmt/src/parse/session.rs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/tools/rustfmt/src/parse/session.rs b/src/tools/rustfmt/src/parse/session.rs index d1a2974a617..34077c5f866 100644 --- a/src/tools/rustfmt/src/parse/session.rs +++ b/src/tools/rustfmt/src/parse/session.rs @@ -114,13 +114,12 @@ 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_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 { |
