diff options
| author | David Wood <david.wood@huawei.com> | 2022-04-12 09:34:40 +0100 |
|---|---|---|
| committer | David Wood <david.wood@huawei.com> | 2022-04-13 02:44:59 +0100 |
| commit | 9bfe0e39e4214c9a76e6c38350286176fa73787a (patch) | |
| tree | d24caebeae01124af5e6ef78735dab042b3bc3ce /compiler/rustc_errors/src/json/tests.rs | |
| parent | f6cef572d6d75a3b7dea5f496d3bd981986e94ca (diff) | |
| download | rust-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_errors/src/json/tests.rs')
| -rw-r--r-- | compiler/rustc_errors/src/json/tests.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/json/tests.rs b/compiler/rustc_errors/src/json/tests.rs index 0f175c732c1..7eb6a4975fe 100644 --- a/compiler/rustc_errors/src/json/tests.rs +++ b/compiler/rustc_errors/src/json/tests.rs @@ -40,7 +40,7 @@ fn test_positions(code: &str, span: (u32, u32), expected_output: SpanTestData) { let sm = Lrc::new(SourceMap::new(FilePathMapping::empty())); sm.new_source_file(Path::new("test.rs").to_owned().into(), code.to_owned()); let fallback_bundle = - crate::fallback_fluent_bundle(false).expect("failed to load fallback fluent bundle"); + crate::fallback_fluent_bundle(rustc_error_messages::DEFAULT_LOCALE_RESOURCES, false); let output = Arc::new(Mutex::new(Vec::new())); let je = JsonEmitter::new( |
