← Rule catalog

Cargo health · Dependencies

Binary crate without a committed Cargo.lock

rust_doctor::cargo::missing_lockfile

Commit Cargo.lock next to the manifest so every build of this binary resolves the same dependency versions.

Category
Dependencies
Default level
warn
Tier
P2
Producer
Cargo health
Diff scope
file

Not a defect when

The binary is an internal example or dev tool in a library repository that deliberately leaves Cargo.lock untracked so CI exercises the latest compatible dependency versions.

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 whole file, since the finding has no span.

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

Set it once in rust-doctor.toml

Other Dependencies rules