← Rule catalog

Structure · Maintainability

Unread feature, or cfg naming an undeclared feature

rust_doctor::structure::unreferenced_feature

Delete the feature nothing reads, or declare the one a cfg already gates; switch this rule off for a stub deliberately kept as published surface.

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

Not a defect when

The feature is a deliberately empty stub kept as published surface so downstream crates that enable it keep compiling after its code was removed or made default.

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::unreferenced_feature=off .
rust-doctor --rule rust_doctor::structure::unreferenced_feature=error .

Set it once in rust-doctor.toml

Other Maintainability rules