about summary refs log tree commit diff
path: root/compiler/rustc_expand
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2022-04-12 09:34:40 +0100
committerDavid Wood <david.wood@huawei.com>2022-04-13 02:44:59 +0100
commit9bfe0e39e4214c9a76e6c38350286176fa73787a (patch)
treed24caebeae01124af5e6ef78735dab042b3bc3ce /compiler/rustc_expand
parentf6cef572d6d75a3b7dea5f496d3bd981986e94ca (diff)
downloadrust-9bfe0e39e4214c9a76e6c38350286176fa73787a.tar.gz
rust-9bfe0e39e4214c9a76e6c38350286176fa73787a.zip
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 <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_expand')
-rw-r--r--compiler/rustc_expand/src/tests.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_expand/src/tests.rs b/compiler/rustc_expand/src/tests.rs
index 88f3cf9d722..693159f9aec 100644
--- a/compiler/rustc_expand/src/tests.rs
+++ b/compiler/rustc_expand/src/tests.rs
@@ -127,8 +127,8 @@ fn test_harness(file_text: &str, span_labels: Vec<SpanLabel>, expected_output: &
     create_default_session_if_not_set_then(|_| {
         let output = Arc::new(Mutex::new(Vec::new()));
 
-        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 source_map = Lrc::new(SourceMap::new(FilePathMapping::empty()));
         source_map.new_source_file(Path::new("test.rs").to_owned().into(), file_text.to_owned());