rust-lang / rust-lang/rust-clippy
New lint: require `since` in `#[deprecated]` attribute
Open
@hashcatHitman is already working on this.
Since Aug 22, 2026.
A-lint
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
What it does
Requires the since field to be present in #[deprecated] attributes
Advantage
Enforce consistency and more documentation for projects which want to always specify which versions an item was deprecated in.
Drawbacks
No response
Example
#[deprecated]
fn foo() {}
Would be warned, should be:
#[deprecated(since="54.0.0")]
Comparison with existing lints
There is deprecated_semver but that only checks the since field is valid if present
Additional Context
Related issue:
We could also have lint for missing message/note?
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.
Assessment
This issue has not been assessed yet.