Skip to content

Commit

Permalink
Auto merge of #101678 - jannic:fix-101640, r=jyn514
Browse files Browse the repository at this point in the history
Add diagnostic arg 'current_crate'

With this fix, I get almost the same error message as on stable, again.

However, I expected to get the new error message `std is required by {$current_crate} because it does not declare #![no_std]`, but I didn't. Instead, I got a new line `help: consider building the standard library from source with cargo build -Zbuild-std`. So I obviously do not fully understand what is going on.

In any case, the bug itself seems to be fixed by this patch.

Closes #101640
  • Loading branch information
bors committed Sep 11, 2022
2 parents 17a627f + 156717d commit 0d56e34
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_metadata/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ impl SessionDiagnostic<'_> for CannotFindCrate {
) -> rustc_errors::DiagnosticBuilder<'_, ErrorGuaranteed> {
let mut diag = handler.struct_err(rustc_errors::fluent::metadata::cannot_find_crate);
diag.set_arg("crate_name", self.crate_name);
diag.set_arg("current_crate", self.current_crate);
diag.set_arg("add_info", self.add_info);
diag.set_arg("locator_triple", self.locator_triple.triple());
diag.code(error_code!(E0463));
Expand Down

0 comments on commit 0d56e34

Please sign in to comment.