Skip to content

Commit 865386e

Browse files
committed
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>
1 parent 41d1340 commit 865386e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

clippy_lints/src/doc.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,10 +621,12 @@ fn check_code(cx: &LateContext<'_>, text: &str, edition: Edition, span: Span) {
621621
let filename = FileName::anon_source_code(&code);
622622

623623
let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
624-
let fallback_bundle = rustc_errors::fallback_fluent_bundle();
624+
let fallback_bundle = rustc_errors::fallback_fluent_bundle()
625+
.expect("failed to load fallback fluent bundle");
625626
let emitter = EmitterWriter::new(
626627
Box::new(io::sink()),
627628
None,
629+
None,
628630
fallback_bundle,
629631
false,
630632
false,

src/driver.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,12 @@ fn report_clippy_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
165165
// Separate the output with an empty line
166166
eprintln!();
167167

168-
let fallback_bundle = rustc_errors::fallback_fluent_bundle();
168+
let fallback_bundle = rustc_errors::fallback_fluent_bundle()
169+
.expect("failed to load fallback fluent bundle");
169170
let emitter = Box::new(rustc_errors::emitter::EmitterWriter::stderr(
170171
rustc_errors::ColorConfig::Auto,
171172
None,
173+
None,
172174
fallback_bundle,
173175
false,
174176
false,

0 commit comments

Comments
 (0)