-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #14715 - chentodd:error_message_fix, r=epage
fix: add source replacement info when no matching package found ### What does this PR try to resolve? Fixes #14697 I updated error message in `resolver/errors` with [Registry::describe_source](https://doc.rust-lang.org/nightly/nightly-rustc/cargo/core/registry/trait.Registry.html#tymethod.describe_source) - Use message from `Registry::describe_source` as default message - If the message is empty, use `SourceId` message and I also updated related test cases. ### How should we test and review this PR? 1. Run following test cases: - resolver-tests - source_replacement - build - directory - local_registry - offline - package - publish - registry - update 2. Run [cargo-bug.zip](https://github.com/user-attachments/files/17493272/cargo-bug.zip) - Unpack the zip archive - Run `cargo build` in the root following message should be seen: ``` error: no matching package named `ahasha` found location searched: directory source `/home/foo/Desktop/cargo-bug/vendor` (which is replacing registry `crates-io`) required by package `example v0.1.0 (/home/foo/Desktop/cargo-bug)` ```
- Loading branch information
Showing
10 changed files
with
90 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters