add an internal lint for nightly-channel-only features without a feature gate
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
we really should not have features that are available only on nightly but do not have a feature gate. this leads to people unknowingly using unstable features, which in turn leads to situations where we have no choice but to stabilize features unchanged because otherwise we break too much of the ecosystem. it also defeats the whole point of -Z allow-features.
we should do two things:
- audit all existing features to make sure they have a feature gate. @jieyouxu tells me that at least
#[cfg(target_has_atomic)]does not. - add an internal lint against
UnstableFeatures::is_nightly_build. basically the only reason it's valid to check this is for diagnostics, or very early in session building, and both of those can add an explicitallow().
@rustbot label A-stability
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the compiler for uses of UnstableFeatures::is_nightly_build and audit existing nightly-only features, including #[cfg(target_has_atomic)]. Start by identifying checks that are only for diagnostics or occur very early in session building. Done means the existing features are covered by gates and the internal lint reports other uses, with explicit allows for the permitted cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100