Skip to content

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

Description

@Jefffrey

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?

Metadata

Metadata

Assignees

Labels

A-lintArea: New lints

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions