A Cargo unused dependencies warning is useful evidence, but silence is not proof that every declared dependency is needed. We built a controlled two-binary fixture on Cargo 1.100.0 to show how the command you choose changes what the diagnostic can tell you.
Five original-fixture checks all succeeded. The default check and the all-targets check each warned about one deliberately unused normal dependency. The first-only, second-only and explicit both-binaries checks produced no such warning. A deliberately unused development dependency remained unwarned in every scope. These are local fixture observations, not a survey of Rust projects.
What the Cargo unused dependencies warning adds
The Rust 1.100.0 announcement, published on 12 November 2026, introduces Cargo’s unused-dependency diagnostic. It cautions that warnings depend on target coverage and that unused development dependencies are not reported. Therefore, record the exact command alongside the result instead of saving only “build passed.”
A warning offers a reason to investigate a declaration. It does not establish that removing it will preserve every supported configuration. Likewise, a successful command without a warning may reflect a limited diagnostic scope. Keep the result connected to the package, manifest table, target selection, features and platform you actually checked.
Build a fixture whose dependency roles are known
Our selected application has two binaries, first and second. A local library named first_only supplies the first binary’s value of 11. Another, second_only, supplies the second binary’s value of 22. The normal dependency unused_normal is deliberately never referenced. A separate unused_dev entry appears under development dependencies.
The names describe designed roles, not inferred real-world usage. All four libraries are local path dependencies. There are no registry downloads, customer repositories or credentials in this exercise. We selected the application package explicitly, rather than claiming to inspect every dependency package’s own manifest.
| Entry | Table | Designed use |
|---|---|---|
| first_only | dependencies | first binary |
| second_only | dependencies | second binary |
| unused_normal | dependencies | none in this fixture |
| unused_dev | dev-dependencies | none in this fixture |
Pin the toolchain and make the lint setting explicit
We ran Cargo 1.100.0, commit 3acc79c0c, on aarch64-apple-darwin. The application declares rust-version 1.100 and explicitly sets the Cargo unused_dependencies lint to warn. The full version output, fixture files and original logs are in the downloadable kit. This is a reproducible local teaching setup, not a test across operating systems.
The Cargo lint reference explains that lint settings belong in the lints.cargo manifest table. It also distinguishes selected packages from their path dependencies. Our explicit setting makes the intended diagnostic level inspectable; do not assume a project with different lint configuration will produce identical output.
Compare the exact command scopes
We first checked each binary separately, then used the explicit bins selection. Finally, we ran the default package check and an all-targets check. Each scope has its own target directory and saved log. We marked a warning observed only when the log actually named that dependency in an unused-dependency diagnostic.

The explicit bins selection is the important surprise. It checked our two binary targets but did not emit the normal-dependency warning. The default and all-targets selections did. Thus, even when you know two target names, the selected command’s diagnostic coverage needs its own evidence. We report this pinned fixture’s output instead of changing the result to match an expectation.

Check a proposed removal in a separate copy
We removed only the unused_normal declaration from a separate copy of the application manifest. The original fixture stays intact. The revised copy passed check –all-targets and test –all-targets. Both tests passed. Running the first and second binaries still printed 11 and 22 respectively.
Those observations support this narrow removal in this fixture. They do not establish that every unused warning is safe to act on automatically. A dependency can have a purpose that a simple source-reference search misses. Record why the declaration exists, then inspect the relevant configurations before accepting a change.

Where the fixture stops
Our fixture has no optional feature matrix, platform-specific dependency table, build script or external service. We did not execute Windows or Linux targets. These omissions are limits, not passing results. A real project needs checks that reflect the configurations it supports, including relevant feature combinations and target platforms.
The Cargo reference also warns about false positives involving transitive feature activation. Separately, development dependencies remain outside this lint’s coverage. Consequently, an all-targets run is useful evidence, yet it is not an exhaustive certificate for every manifest entry or runtime behaviour.
The cargo check manual distinguishes checking from final code generation. Our separate tests and program runs add evidence for the sample outputs. We did not time builds or measure vulnerability exposure, so the report makes no performance or security improvement claim from having one fewer declaration.
Tech Consulting Tailored to Your Coding Journey
Get expert guidance in coding with a personalized consultation. Receive unique, actionable insights delivered in 1-3 business days.
Get StartedDownload the Cargo unused dependencies warning fixture
- Observed diagnostics across five command scopes (CSV)
- Designed dependency roles and manifest tables (CSV)
- Post-removal checks, tests and outputs (CSV)
- Blank dependency-removal evidence worksheet (CSV)
- Original fixture, revised copy, runner and logs (ZIP)
Turn the result into a reviewable maintenance decision
Start with one proposed removal. Record its manifest table and why it was declared, then choose the commands and feature/platform cases relevant to your project. Preserve both the original result and the revised result. If a check was not run, mark it untested rather than extending a passing label to it.
For a US coding class, the included fixture offers a small exercise with inspectable roles and outputs. Read the runner before executing it and adapt its toolchain paths for your installation. The dependency declaration guide helps distinguish normal, development and platform-specific entries before building a wider review.
Continue with our Rust benchmark method and Dependabot review worksheet. Across these tasks, an exact command and a clearly bounded observation are more useful than an unsupported “all clear.”
