From 5b7df246cffdfeeadb95412a0143442a36c08496 Mon Sep 17 00:00:00 2001 From: David Wood Date: Tue, 12 Apr 2022 09:34:40 +0100 Subject: errors: lazily load fallback fluent bundle 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. Signed-off-by: David Wood --- src/driver.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/driver.rs') diff --git a/src/driver.rs b/src/driver.rs index 00dc916b217..32a09fdb9d9 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -165,7 +165,8 @@ fn report_clippy_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) { // Separate the output with an empty line eprintln!(); - let fallback_bundle = rustc_errors::fallback_fluent_bundle(false).expect("failed to load fallback fluent bundle"); + let fallback_bundle = + rustc_errors::fallback_fluent_bundle(rustc_errors::DEFAULT_LOCALE_RESOURCES, false); let emitter = Box::new(rustc_errors::emitter::EmitterWriter::stderr( rustc_errors::ColorConfig::Auto, None, -- cgit 1.4.1-3-g733a5