Skip to content

Commit ea9e8c1

Browse files
committed
Explain why an untranslatable_diagnostic occurs
1 parent 981f625 commit ea9e8c1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/rustc_interface/src/interface.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ pub(crate) fn initialize_checked_jobserver(early_dcx: &EarlyDiagCtxt) {
371371

372372
// JUSTIFICATION: before session exists, only config
373373
#[allow(rustc::bad_opt_access)]
374-
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
375374
pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Send) -> R {
376375
trace!("run_compiler");
377376

@@ -425,7 +424,11 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
425424
config.opts.unstable_opts.translate_directionality_markers,
426425
) {
427426
Ok(bundle) => bundle,
428-
Err(e) => early_dcx.early_fatal(format!("failed to load fluent bundle: {e}")),
427+
Err(e) => {
428+
// We can't translate anything if we failed to load translations
429+
#[allow(rustc::untranslatable_diagnostic)]
430+
early_dcx.early_fatal(format!("failed to load fluent bundle: {e}"))
431+
}
429432
};
430433

431434
let mut locale_resources = config.locale_resources;

0 commit comments

Comments
 (0)