Skip to content

Commit 0eadd99

Browse files
committed
Use fallback fluent bundle from inner emitter in SilentEmitter
1 parent 5e05493 commit 0eadd99

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/parse/session.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,12 @@ fn default_dcx(
114114
false,
115115
);
116116
let emitter = Box::new(
117-
HumanEmitter::new(stderr_destination(emit_color), fallback_bundle.clone())
117+
HumanEmitter::new(stderr_destination(emit_color), fallback_bundle)
118118
.sm(Some(source_map.clone())),
119119
);
120120

121121
let emitter: Box<DynEmitter> = if !show_parse_errors {
122122
Box::new(SilentEmitter {
123-
fallback_bundle,
124123
fatal_emitter: emitter,
125124
fatal_note: None,
126125
emit_fatal_diagnostic: false,
@@ -205,16 +204,7 @@ impl ParseSess {
205204
}
206205

207206
pub(crate) fn set_silent_emitter(&mut self) {
208-
// Ideally this invocation wouldn't be necessary and the fallback bundle in
209-
// `self.parse_sess.dcx` could be used, but the lock in `DiagCtxt` prevents this.
210-
// See `<rustc_errors::SilentEmitter as Translate>::fallback_fluent_bundle`.
211-
let fallback_bundle = rustc_errors::fallback_fluent_bundle(
212-
rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(),
213-
false,
214-
);
215-
self.raw_psess
216-
.dcx()
217-
.make_silent(fallback_bundle, None, false);
207+
self.raw_psess.dcx().make_silent(None, false);
218208
}
219209

220210
pub(crate) fn span_to_filename(&self, span: Span) -> FileName {

0 commit comments

Comments
 (0)