feat: Add -Zlint-rust-version flag#17106
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @weihanglo (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
Why was this reviewer chosen?The reviewer was selected based on:
|
2486c65 to
701d42c
Compare
| } | ||
|
|
||
| if let Some(version) = unit.pkg.manifest().rust_version() | ||
| && bcx.gctx.nightly_features_allowed |
There was a problem hiding this comment.
I don't think we normally implicitly opt-in to unstable features based on the channel (note the name "allowed"). If/when we do, it is part of pre-stabilization.
There was a problem hiding this comment.
I could put this behind a cargo unstable flag, the only worry would be that that wouldn't result in a lot of real world testing of the flag.
There was a problem hiding this comment.
the only worry would be that that wouldn't result in a lot of real world testing of the flag.
That is a valid concern, as this is less likely a flag people would opt-in. I knew you implemented it. How confident are you in the implementation and do we have a clear schedule of incoming stabilization?
The other approach we have is crater run. While the actual lint report varies, crater at least ensure things is not broken.
There was a problem hiding this comment.
The implementation is reasonably simple. I think the main concerns WRT stabilisation would be
- Applying MSRV to a wider set of lints
- More discussion around the exact semantics of the flag (i.e. the linked comment in the tracking issue)
There was a problem hiding this comment.
Encouraging use of this through config would make it easier for more people to opt-in
701d42c to
96724af
Compare
-Zlint-rust-version on nightly-Zlint-rust-version flag
|
It might be good to wait on possible renaming (rust-lang/rust#157574 (comment)) before I push this forward |
|
Would love to see some tests when you get back on this :) |
|
☔ The latest upstream changes (possibly #17012) made this pull request unmergeable. Please resolve the merge conflicts. |
Pass
-Zlint-rust-version={package.rust-version}to rustc when-Zlint-rust-versionis passed to Cargo, and therust-versionfield is enabled.This flag was implemented at rust-lang/rust#157707.
Tracking issue: rust-lang/rust#157574