1
Fork 0

Use better heuristic for printing Cargo specific diagnostics

This commit is contained in:
Urgau 2024-02-17 16:45:59 +01:00
parent bccb9bbb41
commit d988d8f4ba
10 changed files with 34 additions and 13 deletions

View file

@ -362,8 +362,11 @@ impl<G: EmissionGuarantee> IntoDiagnostic<'_, G> for LinkingFailed<'_> {
// which by now we have no way to translate.
if contains_undefined_ref {
diag.note(fluent::codegen_ssa_extern_funcs_not_found)
.note(fluent::codegen_ssa_specify_libraries_to_link)
.note(fluent::codegen_ssa_use_cargo_directive);
.note(fluent::codegen_ssa_specify_libraries_to_link);
if rustc_session::utils::was_invoked_from_cargo() {
diag.note(fluent::codegen_ssa_use_cargo_directive);
}
}
diag
}