rust-lang / rust-lang/rust-clippy
`expect_unstable` lint for feature instability assertions
Open
Nobody has claimed this yet.
A-lint
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
What it does
This lint notifies a user when a given feature is stable. It lets users mark blocks, items, and statements with an expectation: #[expect_unstable("some_unstable_feature")]
Configuration
follow-msrv: Whether the crate's MSRV should be considered when checking for this lint. If the feature is stable, but the MSRV is set to something lower than the stabilized version, the lint will not apply. (default:true)
Advantage
- Avoids confusing (and difficult-to-track) TODOs and FIXMEs where unstable features would improve source code.
- Allows users to get rid of manual checks in CI.
- Refines project quality as Rust contributors refine the language.
Drawbacks
No response
Example
// FIXME: make sure to use `core::error::Error` when stable!
// i sure hope someone notices this after 1.81..!
use std::error::Error;
Could be written as:
#[expect_unstable("error_in_core")]
use std::error::Error;
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
No implementation file or test is named. Start by locating Clippy's existing lint and configuration patterns, then review how Rust feature stability and MSRV checks are represented; done means the proposed expect_unstable syntax, follow-msrv behavior, and diagnostics are covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100