-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Recommend package.rust-version
in the Rust version section of reference/semver.md
.
#15806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Adds a recommendation that, to mitigate “possibly breaking” Rust version requirement increases, they should be declared using `package.rust-version`. My main goal in this change is to make it *possible to find* the Rust version section in this page by searching it, but the most appropriate way to fit it into this section seemed to me to be making this recommendation. Declaring (and maintaining) `package.rust-version` is additional work, but it is a much lesser burden on maintainers than other items in the same list such as "Provide a large window of support".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
@@ -2028,6 +2028,8 @@ Mitigation strategies: | |||
[`#[cfg(accessible(..))]`][cfg-accessible] features which provide an opt-in | |||
mechanism for new features. These are currently unstable and only available | |||
in the nightly channel. | |||
* Use [`package.rust-version`] to declare your package’s compatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Instead of
cargo update
, should we say "Cargo's dependency resolution"? - MSRV resolver at this moment is best-effort, it will still fall back to incompatible version if nothing found, if we want to be more precise.
* Use [`package.rust-version`] to declare your package’s compatibility. | ||
This allows `cargo update` to avoid introducing an incompatible update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of:
* Use [`package.rust-version`] to declare your package’s compatibility. | |
This allows `cargo update` to avoid introducing an incompatible update. | |
* Specify your minimum-supported Rust version by setting [`package.rust-version`], allowing Cargo to [select older versions of your package] when needed rather than erroring. Be sure to consider the [support expectations] when doing so. | |
[`package.rust-version`]: https://doc.rust-lang.org/cargo/reference/rust-version.html | |
[select older versions of your package]: https://doc.rust-lang.org/cargo/reference/resolver.html#rust-version | |
[support expectations]: https://doc.rust-lang.org/cargo/reference/rust-version.html#support-expectations |
- Re-orders and rewords things so the emphasis is on your package's support, to avoid people setting and forgetting this and it being wrong
- Explicitly calling out support expectations to avoid people setting and forgetting this and it being wrong
- Applies feedback from weihanglo
Also, based on what we've written for the package.rust-version
page, I think it would be fine to list this first, rather than last.
Adds a recommendation that, to mitigate “possibly breaking” Rust version requirement increases, they should be declared using
package.rust-version
.My main goal in this change is to make it possible to find the Rust version section in this page by searching it, but the most appropriate way to fit it into this section seemed to me to be making this recommendation. Declaring (and maintaining)
package.rust-version
is additional work, but it is a much lesser burden on maintainers than other items in the same list such as "Provide a large window of support".