This cargo subcommand tries to to detect pub methods that are unused in an entire workspace, by performing workspace-wide analysis.
The dead_code Rust compiler lint ignores pub methods, given that:
pub methods could be used in another workspace crate, or be part of a public API.See also the following discussions about this problem:
$ cargo workspace-unused-pub --help
Detect unused pub methods in a workspace
Usage: cargo workspace-unused-pub [OPTIONS] [WORKSPACE]
Arguments:
[WORKSPACE] [default: current workspace]
Options:
--scip <SCIP>
--extensions <EXTENSIONS> [default: rs,html]
-h, --help Print help
-V, --version Print version
Detection is performed in multiple phases:
Opened SCIP file with 806 documents
Note that the index generation can take a significant amount of time on large workspaces.
Found 6722 declarations and 286 traits
Pass 1: 1419 candidates
main, tests and trait methods.Pass 2 (mains, tests, trait methods): 189 candidates
Pass 3 (search): 43 candidates
Found 43 possibly unused functions
The extensions that are searched are defined by the --extensions flag.

The output of each phase (in the format above) can be viewed by setting the RUST_LOG=debug environment variable.
save-analysis feature, and therefore requires an older nightly compiler. See https://github.com/est31/warnalyzer/issues/9$ claude mcp add cargo-workspace-unused-pub \
-- python -m otcore.mcp_server <graph>