Closed
Description
RFC: https://github.com/rust-lang/rfcs/blob/master/text/2495-min-rust-version.md
Rust tracking issue: rust-lang/rust#65262
Initial implementation: #8037
Documentation: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field
Concise description of the implementation:
- An optional
rust-version
field in theCargo.toml
package
section, which can contain a version number like"1.43.1"
or"1.56"
. It must be a single version number, with no semver operator(s) or pre-release identifier. The version must be equal to or newer than the version that first introduces support for the configured edition. - If specified, Cargo versions newer than the one stabilizing this feature will start to fail any compile-like commands with an error referring to the specified
rust-version
if the crate is compiled with an older version of the compiler. Pre-release identifiers for the active compilers are ignored for purposed of comparison. - The
rust-version
field may be ignored using the--ignore-rust-version
option.
Metadata
Metadata
Assignees
Type
Projects
Status
Milestone
Relationships
Development
No branches or pull requests
Activity
djc commentedon Jul 21, 2021
My call for testing in https://users.rust-lang.org/t/call-for-testing-unstable-cargo-support-for-rust-version/59386/4 has not yielded any explicit feedback (other than likes on the post). What should we do next? Would be nice to have this stabilized (the edition coming up is also one reason why this might start being more useful).
ehuss commentedon Jul 22, 2021
I think stabilizing would be fine. Just need to submit a PR, updating the documentation, and write a clear description of what is being stabilized.
djc commentedon Jul 27, 2021
What is being stabilized:
rust-version
field in theCargo.toml
package
section, which can contain a version number like"1.43.1"
or"1.56"
. It must be a single version number, with no semver operator(s) or pre-release identifier. The version must be equal to or newer than the version that first introduces support for the configured edition.rust-version
if the crate is compiled with an older version of the compiler. Pre-release identifiers for the active compilers are ignored for purposed of comparison.rust-version
field may be ignored using the--ignore-rust-version
option.Auto merge of #9732 - djc:rust-version-docs, r=ehuss
ehuss commentedon Aug 3, 2021
Closing as this has been stabilized in #9732.
djc commentedon Aug 5, 2021
Shouldn't cargo tracking issue FCPs get tracked in This Week in Rust?
est31 commentedon Apr 11, 2022
List of issues in rust related tooling to provide support for the new feature:
rust-version
from Cargo.toml actions-rs/toolchain#206rust-version
field inCargo.toml
to specify the MSRV rust-clippy#7765