Skip to content

cargo add takes package.rust-version into account when no version-req is specified #10653

Closed
@epage

Description

@epage
Contributor

Problem

When running cargo add foo, we create a version-req out of the latest version in the index. If this has a higher rust-version, then that can break for people.

Proposed Solution

Constrain the candidate versions in the index by their rust-version being lesser or equal to the current crate's rust-version.

The main question is what to do when there are no matches due to rust-version.

  • Add anyways
  • Error with newest version's rust-version

Notes

No response

Activity

added
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
on May 11, 2022
epage

epage commented on May 11, 2022

@epage
ContributorAuthor
epage

epage commented on Jul 26, 2022

@epage
ContributorAuthor

When rust-version gets added to the registry, we should inform Dependabot people on dependabot/dependabot-core#5423

added a commit that references this issue on Apr 28, 2023

Auto merge of #12043 - epage:rust-version, r=weihanglo

cassaundra

cassaundra commented on May 2, 2023

@cassaundra
Contributor

@rustbot claim

12 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-add

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @epage@cassaundra

      Issue actions

        `cargo add` takes `package.rust-version` into account when no version-req is specified · Issue #10653 · rust-lang/cargo