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>
This commit is contained in:
David Wood 2022-03-28 09:36:20 +01:00
parent 6eea2a88c1
commit f8ad4b5cf8

View File

@ -114,10 +114,12 @@ fn default_handler(
let emitter = if hide_parse_errors {
silent_emitter()
} else {
let fallback_bundle = rustc_errors::fallback_fluent_bundle();
let fallback_bundle = rustc_errors::fallback_fluent_bundle()
.expect("failed to load fallback fluent bundle");
Box::new(EmitterWriter::stderr(
color_cfg,
Some(source_map.clone()),
None,
fallback_bundle,
false,
false,