Structure · Reliability
File-wide or module-wide inner allow attribute
rust_doctor::structure::crate_level_allow
Scope the allow to the item that needs it; a file-wide or module-wide exemption, reasoned or not, also silences every future finding in its reach.
- Category
- Reliability
- Default level
- warn
- Tier
- P2
- Producer
- Structure
- Diff scope
- line
Not a defect when
The file is generated code nobody edits by hand, such as bindgen or protobuf output, where a file-wide allow is the only practical scope.
What it reads
Complexity, and families of near-duplicate code.
Tier
Ordinary defect.
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::crate_level_allow=off .
rust-doctor --rule rust_doctor::structure::crate_level_allow=error .