fix(update): don't reuse a previously locked dependency if multiple major versions are compatible
What does this PR try to resolve?
Fixes https://github.com/rust-lang/cargo/issues/5529. Fixes https://github.com/rust-lang/cargo/issues/14115. Fixes https://github.com/rust-lang/cargo/issues/14446.
How should we test and review this PR?
This first commit adds a test documenting the current behavior, and the second commit implements the fix and updates the test.
Additional information
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @epage (or someone else) some time within the next two weeks.
Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:
-
@rustbot author: the review is finished, PR author should check the comments and take action accordingly -
@rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
As a heads up, none of these issues are marked as A-accepted but instead S-needs-design (see Issues in contrib docs). It would generally be best to explore the high level ideas in the Issue before moving on to a PR (even if playing with an implementation locally) so we keep the solution space exploration in one place and leave the PR to focus on the implementation. Sometimes PRs come and go for the same issue and if we explore designs in PRs, it fractures the conversation.
@Eh2406 can better speak to whether we can shortcircuit that and move forward with this.
r? @Eh2406
btw another issue with multi-major version reqs is #9029 with #13535 as a proposed change for it.
:umbrella: The latest upstream changes (presumably #14569) made this pull request unmergeable. Please resolve the merge conflicts.
:umbrella: The latest upstream changes (possibly 081d7bac633bbc72883fb74fb4993bb1b1a2df4a) made this pull request unmergeable. Please resolve the merge conflicts.