Auto merge of #95968 - davidtwco:translation-lazy-fallback, r=oli-obk

errors: lazily load fallback fluent bundle

Addresses (hopefully) https://github.com/rust-lang/rust/pull/95667#issuecomment-1094794087.

Loading the fallback bundle in compilation sessions that won't go on to emit any errors unnecessarily degrades compile time performance, so lazily create the Fluent bundle when it is first required.

r? `@ghost` (just for perf initially)
This commit is contained in:
bors 2022-04-13 21:04:19 +00:00
commit 34a6c9f26e
19 changed files with 94 additions and 81 deletions

View file

@ -1731,7 +1731,7 @@ impl Emitter for SharedEmitter {
None
}
fn fallback_fluent_bundle(&self) -> &Lrc<rustc_errors::FluentBundle> {
fn fallback_fluent_bundle(&self) -> &rustc_errors::FluentBundle {
panic!("shared emitter attempted to translate a diagnostic");
}
}