Closed
Description
What it does
The #![feature(lint_reasons)]
adds a new #[expect]
attribute as described in RFC 2383.
It would be cool to have a restriction lint, that suggests replacing all #[allow]
attributes with #[expect]
.
Lint Name
allow_attribute
Category
restriction
Notes
- This should be a restriction lint, as the
allow
attribute has valid use cases. - The lint has to check for the
lint_reasons
feature. - The lint should probably ignore crate attributes, or at least have an option to allow them. Crate attributes are
#![attr]
in the root of the crate.
Example
#[allow(unused)]
let x = 0;
Could be written as:
#[expect(unused)]
let x = 0;