-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add a lint for writing #[feature]
for stable features, warn by default...
#21958
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
…ult. The 'stable_features' lint helps people progress from unstable to stable Rust by telling them when they no longer need a `feature` attribute because upstream Rust has declared it stable. This compares to the existing 'unstable_features', which is used to implement feature staging, and triggers on *any* use of `#[feature]`.
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @alexcrichton cc @aturon |
This seems to give me errors like:
IIRC all lints are set to Deny on stage2 builds. I think. |
.... The 'stable_features' lint helps people progress from unstable to stable Rust by telling them when they no longer need a `feature` attribute because upstream Rust has declared it stable. This compares to the existing 'unstable_features' lint, which is used to implement feature staging, and triggers on *any* use of `#[feature]`.
⌛ Testing commit 456d23e with merge a83f5f9... |
💔 Test failed - auto-mac-32-opt |
@bors: retry |
@Manishearth huh, the unused features lint didn't change much here. maybe a problem in other rollup patches. i'll test this again locally. |
Nah, I found the issue :) |
⌛ Testing commit 456d23e with merge aca22ed... |
💔 Test failed - auto-linux-64-x-android-t |
…notes_version_stabilized, r=brson stable features lint warning mentions version stabilized To accomplish this, we alter the checks in `rustc::middle::stability` to use the `StabilityLevel` defined in `syntax::attr` (which includes the version in which the feature was stabilized) rather than the local `StabilityLevel` in the same module, and make the `declared_stable_lang_features` field of `syntax::feature_gate::Features` hold a Vec of feature-name, span tuples (in analogy to the `declared_lib_features` field) rather than just spans. Fixes rust-lang#33394.  r? @brson (tagging Brian because he [wrote](rust-lang#21958) the lint)
....
The 'stable_features' lint helps people progress from unstable to
stable Rust by telling them when they no longer need a
feature
attribute because upstream Rust has declared it stable.
This compares to the existing 'unstable_features' lint, which is used
to implement feature staging, and triggers on any use
of
#[feature]
.