rust-lang / rust-lang/rust-clippy

New lint: require `since` in `#[deprecated]` attribute

Open
#17,595 1 comment 0 reactions 1 assignee View on GitHub

@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

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.