bin+lib cargo-udeps

Find unused dependencies in Cargo.toml

44 releases

0.1.44 Nov 23, 2023
0.1.42 Aug 27, 2023
0.1.41 Jul 20, 2023
0.1.35 Nov 3, 2022
0.1.5 Sep 27, 2019

#50 in Cargo plugins

Download history 3899/week @ 2023-08-18 4834/week @ 2023-08-25 4052/week @ 2023-09-01 4365/week @ 2023-09-08 3905/week @ 2023-09-15 3436/week @ 2023-09-22 3418/week @ 2023-09-29 4083/week @ 2023-10-06 4527/week @ 2023-10-13 4272/week @ 2023-10-20 3899/week @ 2023-10-27 4135/week @ 2023-11-03 4339/week @ 2023-11-10 4802/week @ 2023-11-17 5582/week @ 2023-11-24 3964/week @ 2023-12-01

19,350 downloads per month




crates.io dependency status

Find unused dependencies in Cargo.toml.

While compilation of this tool also works on Rust stable, it needs Rust nightly to actually run.


GitHub Releases


cargo install (crates.io)

cargo install cargo-udeps --locked

cargo install (master)

cargo install --git https://github.com/est31/cargo-udeps --locked

Dedicated packages

Some package managers have packaged cargo-udeps:

  • Nix/Nix OS: cargo-udeps
  • Arch Linux: pacman -S cargo-udeps
  • Homebrew: brew install cargo-udeps


cargo +nightly udeps

It either prints out a "unused crates" line listing the crates, or it prints out a line saying that no crates were unused.

Ignoring some of the dependencies

To ignore some of the dependencies, add package.metadata.cargo-udeps.ignore to Cargo.toml.

normal = ["if_chain"]
#development = []
#build = []

if_chain = "1.0.0" # Used only in doc-tests, which `cargo-udeps` cannot check.

Known bugs

  • Some unused crates might not be detected. This includes crates used by std and its dependencies as well as crates that are already being used by dependencies of the studied crate.

  • Crates are currently only handled on a per name basis. Two crates with the same name but different versions would be a problem.

Trophy case

This is a list of cases where unused dependencies were found using cargo-udeps. You are welcome to expand it:


See CONTRIBUTING.md for details.


This tool is distributed under the terms of both the MIT license and the Apache License (Version 2.0), at your option.

See LICENSE for details.

License of your contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~1.5M SLoC