Consider rust-version when selecting packages for cargo add by cassaundra · Pull Request #12078 · rust-lang/cargo
cassaundra
changed the title
Cargo add rust version
Consider rust-version when selecting packages for cargo add
When `-Zmsrv-policy` is enabled, try to select dependencies which satisfy the target package's `rust-version` field (if present). If the selected version is not also the latest, emit a warning to the user about this discrepancy. Dependency versions without a `rust-version` are considered compatible by default. Implements rust-lang#10653.
bors
added
S-waiting-on-bors
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.labels
May 23, 2023
epage
mentioned this pull request
This was referenced
May 25, 2023
epage
mentioned this pull request
bors added a commit that referenced this pull request
Aug 25, 2023refactor: Pull out cargo-add MSRV code for reuse ### What does this PR try to resolve? #12078 added MSRV code in `cargo add`. Our assumption when writing it is that we'd need to generalize the code before reusing it in other places, like `cargo install`. This PR focused purely on that refactor because I'm hopeful it will be useful for other work I'm doing. Despite not having a user for this yet, I think the `cargo install` case is inevitable and I feel this does a bit to clean up MSRV related code by using a more specific type everywhere. ### How should we test and review this PR? Each commit gradually progresses things along
bors added a commit that referenced this pull request
Apr 1, 2024Remove useless parameters ### What does this PR try to resolve? From #12078 (comment)
This file contains hidden or 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