rust-lang / rust-lang/rust-clippy

`expect_unstable` lint for feature instability assertions

Open
#13,330 4 comments 3 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.