← Rule catalog

Structure · Maintainability

Allow attribute without a reason argument

rust_doctor::structure::unreasoned_allow_attribute

Fix what the lint reports, or keep the allow and state why with reason = "..." so the exemption survives review.

Category
Maintainability
Default level
warn
Tier
P3
Producer
Structure
Diff scope
line

Not a defect when

The crate's MSRV predates Rust 1.81, which stabilized the reason argument on lint attributes, and the justification is written in an adjacent comment instead.

What it reads

Complexity, and families of near-duplicate code.

Tier

Lowest tier: real, and rarely urgent.

The tier bounds how severe a rule may be; its category bounds the tier.

Diff scope

The changed line itself.

What --scope contextual looks at to decide whether a change caused the finding.

Change it

Turn it off, or make it blocking, without touching the code it flags:

rust-doctor --rule rust_doctor::structure::unreasoned_allow_attribute=off .
rust-doctor --rule rust_doctor::structure::unreasoned_allow_attribute=error .

Set it once in rust-doctor.toml

Other Maintainability rules