diff options
| author | David Wood <david.wood@huawei.com> | 2022-03-28 09:36:20 +0100 |
|---|---|---|
| committer | David Wood <david.wood@huawei.com> | 2022-04-05 07:01:02 +0100 |
| commit | d5119c5b9f1f71090d078e945ea6b5d39d08cffa (patch) | |
| tree | d63f8049bf2692b7fe2d34bf9e86ec7c26af6fe3 /compiler/rustc_errors/src/json | |
| parent | 7f91697b5035f8620df4de47057024c3539b55a6 (diff) | |
| download | rust-d5119c5b9f1f71090d078e945ea6b5d39d08cffa.tar.gz rust-d5119c5b9f1f71090d078e945ea6b5d39d08cffa.zip | |
errors: implement sysroot/testing bundle loading
Extend loading of Fluent bundles so that bundles can be loaded from the sysroot based on the language requested by the user, or using a nightly flag. Sysroot bundles are loaded from `$sysroot/share/locale/$locale/*.ftl`. Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_errors/src/json')
| -rw-r--r-- | compiler/rustc_errors/src/json/tests.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/json/tests.rs b/compiler/rustc_errors/src/json/tests.rs index fa0ccd65d06..4174a85204f 100644 --- a/compiler/rustc_errors/src/json/tests.rs +++ b/compiler/rustc_errors/src/json/tests.rs @@ -39,13 +39,15 @@ fn test_positions(code: &str, span: (u32, u32), expected_output: SpanTestData) { rustc_span::create_default_session_globals_then(|| { 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(); + let fallback_bundle = + crate::fallback_fluent_bundle().expect("failed to load fallback fluent bundle"); let output = Arc::new(Mutex::new(Vec::new())); let je = JsonEmitter::new( Box::new(Shared { data: output.clone() }), None, sm, + None, fallback_bundle, true, HumanReadableErrorType::Short(ColorConfig::Never), |
