diff options
| author | Urgau <urgau@numericable.fr> | 2024-02-17 16:45:59 +0100 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2024-02-17 16:49:01 +0100 |
| commit | d988d8f4ba069e11ace537feea4e4e226e7f4afe (patch) | |
| tree | 1eb3889c87093c5fdaf3dc22617c69f8479105f2 /compiler/rustc_codegen_ssa/src | |
| parent | bccb9bbb418a30aeb332052e721beb6ebc6b1ce7 (diff) | |
| download | rust-d988d8f4ba069e11ace537feea4e4e226e7f4afe.tar.gz rust-d988d8f4ba069e11ace537feea4e4e226e7f4afe.zip | |
Use better heuristic for printing Cargo specific diagnostics
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/errors.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/errors.rs b/compiler/rustc_codegen_ssa/src/errors.rs index 3d7903b5efb..e42a8bd9ed9 100644 --- a/compiler/rustc_codegen_ssa/src/errors.rs +++ b/compiler/rustc_codegen_ssa/src/errors.rs @@ -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 } |
