Consider rust-version when selecting packages for cargo add by cassaundra · Pull Request #12078 · rust-lang/cargo

@cassaundra cassaundra changed the title Cargo add rust version Consider rust-version when selecting packages for cargo add

May 2, 2023

epage

@rustbot rustbot added the A-cli

Area: Command-line interface, option parsing, etc.

label

May 4, 2023

cassaundra

cassaundra

epage

epage

epage

epage

epage

epage

epage

epage

epage

epage

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.

@cassaundra

@cassaundra

@cassaundra

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

May 23, 2023

@epage epage mentioned this pull request

May 23, 2023

bors added a commit to rust-lang-ci/rust that referenced this pull request

May 23, 2023

This was referenced

May 25, 2023

saethlin pushed a commit to saethlin/miri that referenced this pull request

May 26, 2023

@epage epage mentioned this pull request

Aug 24, 2023

bors added a commit that referenced this pull request

Aug 25, 2023
refactor: 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, 2024
Remove useless parameters

### What does this PR try to resolve?

From #12078 (comment)