Skip to content

Tracking issue for RFC 2495, "Minimum Supported Rust Version" #65262

@Centril

Description

@Centril
Contributor

This is a tracking issue for the RFC "Minimum Supported Rust Version" (rust-lang/rfcs#2495).

Note: There is a separate tracking issue on the Cargo side at: rust-lang/cargo#8072

Documentation: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field

Steps:

  • Implement the RFC (cc @rust-lang/cargo -- can anyone write up mentoring
    instructions?)
    Adjust documentation (see instructions on rustc-guide)

Unresolved questions:

  • Name bike-shedding: rust vs rustc vs min-rust-version
  • Additional checks?
  • Better description of versions resolution algorithm.
  • How nightly versions will work with "cfg based MSRV"?

Activity

added
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.
T-cargoRelevant to the cargo team, which will review and decide on the PR/issue.
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
on Oct 10, 2019
jhpratt

jhpratt commented on Oct 10, 2019

@jhpratt
Member

My personal opinions:

Namemin-rust-version or msrv. The latter may have already been declined, but if accompanied by documentation it's certainly already relatively widespread.

NightlyBoth the dated version (2019-10-10) and the semver version (1.40.0 for when 1.38.0 is stable). The latter could be somewhat confusing, as I've never seen nightly referred to like that in practice. I no longer believe this is the best case. Using 2019-10-10 or nightly-2019-10-10 would be preferred.

Majkl578

Majkl578 commented on Oct 11, 2019

@Majkl578

Name bike-shedding: rust vs rustc vs min-rust-version

My personal preference would be rust-version. min-rust-version is a bit too long and msrv is a bit cryptic abbreviation for newcomers (when I first saw it I was like what Microsoft stuff is this referring to).

Regarding nightly versions: I do not like the suggestion by @jhpratt to use semver version for nightly (e.g. 1.40.0) because the constraint is too wide. I think using nightly-2019-10-10 (meaning nightly from 2019-10-10 or newer) would be better and specific enough.
Cargo then needs to be able to resolve what real semver version this refers to and when e.g. 2019-10-10 means 1.40.0 then stable 1.41.0 would be valid too.

mathstuf

mathstuf commented on Oct 11, 2019

@mathstuf
Contributor

Agreed with @Majkl578 about the nightly via semver thing. Just because nightly has your feature today doesn't mean it will appear in the stable release with that version number.

topokel

topokel commented on Dec 9, 2019

@topokel

I went through the discussions and I couldn't see anyone discussing representing the version as a semver version requirement like package dependencies, only instead defaulting to a >= xxx comparison operator when none is present instead of a caret operator. This would be useful personally, preserves the already proposed functionality, and seems like it'd reuse existing code. This leaves the nightly question open, however. Which perhaps would have to be a special case over all of that? 😅

Lokathor

Lokathor commented on Dec 9, 2019

@Lokathor
Contributor

Minimum rust version should absolutely be a semver comparison, yes.

topokel

topokel commented on Dec 9, 2019

@topokel

I read the RFC a second time and saw a part suggesting semver comparison but I'm leaving my comment to keep the use-case clearly vocalized

newpavlov

newpavlov commented on Dec 9, 2019

@newpavlov
Contributor

the use-case clearly vocalized

What is this use-case though? In your previous post you only said it would be useful for you personally, without specifying why exactly. In the RFC I've wrote:

value should be a version in semver format without range operators.

exactly because I didn't see why it would be useful outside of the nightly extension, and even with the extension I am not 100% sure this feature would pull its weight. Also IIRC during discussion no one have brought any substantial arguments for supporting range operators with "1.X" versions.

topokel

topokel commented on Dec 9, 2019

@topokel

Targeting a specific Rust ABI would require pinning the Rustc version to an exact number. This can easily be accomplished with semver without developing an entirely new syntax

84 remaining items

joshtriplett

joshtriplett commented on Sep 17, 2021

@joshtriplett
Member

This is on track to be stabilized in 1.56.

newpavlov

newpavlov commented on Sep 18, 2021

@newpavlov
Contributor

@joshtriplett
Great! What about the proposed MSRV-dependent dependency version resolution? Should we open a separate Rust or Cargo issue?

joshtriplett

joshtriplett commented on Sep 19, 2021

@joshtriplett
Member

@newpavlov That was moved to future work because, among other things, it would need some confirmation that the proposed approach to resolution is something we'd want to do. Given such confirmation, someone would then need to submit a PR implementing it.

ehuss

ehuss commented on Sep 20, 2021

@ehuss
Contributor

Sorry, forgot that there was a second tracking issue. Closing as this has been stabilized in rust-lang/cargo#9732.

newpavlov

newpavlov commented on Sep 21, 2021

@newpavlov
Contributor

I went ahead and created a separate issue for MSRV-dependent dependency version resolution: #89136

added a commit that references this issue on Sep 26, 2021
added a commit that references this issue on Oct 4, 2021
added a commit that references this issue on Oct 7, 2021
peter-lyons-kehl

peter-lyons-kehl commented on Nov 17, 2022

@peter-lyons-kehl
Contributor

To save people's time: As per https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-rust-version-field, the field is called rust-version.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.B-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-cargoRelevant to the cargo team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @steveklabnik@cuviper@ehuss@dekellum@mathstuf

        Issue actions

          Tracking issue for RFC 2495, "Minimum Supported Rust Version" · Issue #65262 · rust-lang/rust