OS Manuals

/usr/bin/cargo-clippy

Empowering everyone to build reliable and efficient software.

From rust-1.99 1.99.1-r2 (os), captured 2026-11-05 by running cargo-clippy --help (exit 0). permalink

Also provided by 20 other package versions
Checks a package to catch common mistakes and improve your Rust code.

Usage:
    cargo clippy [OPTIONS] [--] [<ARGS>...]

Common options:
    --no-deps                Run Clippy only on the given crate, without linting the dependencies
    --fix                    Automatically apply lint suggestions. This flag implies --no-deps and --all-targets
    -h, --help               Print this message
    -V, --version            Print version info and exit
    --explain [LINT]         Print the documentation for a given lint

See all options with cargo check --help.

Allowing / Denying lints

To allow or deny a lint from the command line you can use cargo clippy -- with:

    -W / --warn [LINT]       Set lint warnings
    -A / --allow [LINT]      Set lint allowed
    -D / --deny [LINT]       Set lint denied
    -F / --forbid [LINT]     Set lint forbidden

You can use tool lints to allow or deny lints from your code, e.g.:

    #[allow(clippy::needless_lifetimes)]

Manifest Options:
    --manifest-path <PATH>  Path to Cargo.toml
    --frozen                Require Cargo.lock and cache are up to date
    --locked                Require Cargo.lock is up to date
    --offline               Run without accessing the network
Options (13)
OptionDescriptionSource
--no-depsRun Clippy only on the given crate, without linting the dependencieshelp
--fixAutomatically apply lint suggestions.help
-h, --helpPrint this messagehelp
-V, --versionPrint version info and exithelp
--explain LINTPrint the documentation for a given linthelp
-W /Set lint warningshelp
-A /Set lint allowedhelp
-D /Set lint deniedhelp
-F /Set lint forbiddenhelp
--manifest-path PATHPath to Cargo.tomlhelp
--frozenRequire Cargo.lock and cache are up to datehelp
--lockedRequire Cargo.lock is up to datehelp
--offlineRun without accessing the networkhelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.