What it does
Currently allow_attributes works only on allow, but doesn't trigger on expect.
The allow_attributes_without_reason works differently, it applies to both allow and expect.
It would be nice if these could be set separately, so that allow_attributes_without_reason only applied to
#[allow()] and expect_attributes_without_reason could apply the same logic to expect.
Advantage
The allow_attributes lint is too much for many cases, such as when you conditionally need an allow in a #[cfg()] where #[expect(...)] is too strong.
We would like to be able to use:
#[allow(...) reason = "...."]
#[expect(something_else)]
but erroring on
#[allow(some_other_thing)]
Moving expect_attributes_without_reason to it's own lint would allow this kind of flexibility.
Drawbacks
People relying on the current behavior of allow_attributes_without_reason need to enable another lint to keep that behavior.
Example
Could be written as:
Comparison with existing lints
No response
Additional Context
No response
What it does
Currently
allow_attributesworks only onallow, but doesn't trigger on expect.The
allow_attributes_without_reasonworks differently, it applies to bothallowandexpect.It would be nice if these could be set separately, so that
allow_attributes_without_reasononly applied to#[allow()]andexpect_attributes_without_reasoncould apply the same logic to expect.Advantage
The
allow_attributeslint is too much for many cases, such as when you conditionally need an allow in a#[cfg()]where#[expect(...)]is too strong.We would like to be able to use:
but erroring on
Moving
expect_attributes_without_reasonto it's own lint would allow this kind of flexibility.Drawbacks
People relying on the current behavior of
allow_attributes_without_reasonneed to enable another lint to keep that behavior.Example
<code>Could be written as:
<code>Comparison with existing lints
No response
Additional Context
No response