Cargo health · Dependencies
Declared dependency no source references
rust_doctor::cargo::unused_dependency
Remove the entry no source references, or switch this rule off with --rule or rust-doctor.toml for a crate needed for linking alone; references made only through macro expansion or doctests are not seen.
- Category
- Dependencies
- Default level
- warn
- Tier
- P2
- Producer
- Cargo health
- Diff scope
- line
Not a defect when
The crate is needed only for linking or a side effect, such as a native library or an allocator, or it is referenced solely through macro expansion or doctests, which the scan does not see.
What it reads
Cargo.toml, Cargo.lock and .cargo/config.toml.
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::cargo::unused_dependency=off .
rust-doctor --rule rust_doctor::cargo::unused_dependency=error .