Code editors and AI coding tools · Researched comparison
Best Rust Linters in 2026
Clippy is the first pick for most Rust developers. It ships with the standard toolchain, runs through Cargo, and catches hundreds of correctness, style and performance issues out of the box. For dependency and supply-chain checks, cargo-deny and cargo-audit cover licence, advisory and duplicate-crate rules. Teams that want a stricter, configurable style layer often add dylint or cargo-machete depending on what they need to enforce.
We run no ads and no affiliate links at launch. The order of a list follows our published method.
Prices are the starting prices vendors list publicly. Plans change, so confirm the current price on the vendor page before you buy.
Key takeaways
Clippy is free, open source, and installed with rustup, so it is the default lint pass for nearly every Rust project.
cargo-deny and cargo-audit focus on dependencies and security advisories rather than your own source code.
dylint lets teams write and load custom lint rules as separate crates when Clippy does not cover a rule.
All of these tools run locally and offline, so no source code needs to leave your machine.
Tool
Best for
Standout feature
Listed starting price
Free plan or trial
1 Clippy
General-purpose lints for everyday Rust code
Ships with rustup
Free (open source)
Free plan
2 cargo-deny
Dependency licence, advisory and duplicate checks
Checks licences, advisories, bans and sources in one config
Free (open source)
Free plan
3 cargo-audit
Checking dependencies against security advisories
Simple one-command advisory scan
Free (open source)
Free plan
4 dylint
Teams that need custom lint rules
Write lints as separate crates
Free (open source)
Free plan
5 rustfmt
Enforcing consistent code formatting
Official formatter
Free (open source)
Free plan
6 cargo-machete
Finding unused dependencies in Cargo.toml
Fast unused-dependency detection
Free (open source)
Free plan
7 semgrep
Custom pattern-based rules across languages
Supports Rust plus many other languages
See vendor pricing page
Free plan
How we picked
We picked tools that run on Rust projects today and are actively maintained, based on vendor documentation, project repositories and public pricing pages. Criteria were fit for source-level or dependency linting, platform support, licence and price, whether analysis runs locally, and the practical limits of each tool. We did not run benchmarks or collect user reviews. Prices and plan limits change, so confirm details on the vendor site before you commit.
01
Clippy
Best for: General-purpose lints for everyday Rust code
Clippy is the official Rust linter maintained by the Rust project. It runs as `cargo clippy` and checks your crate for correctness issues, suspicious patterns, style problems and performance traps. Lints are grouped into levels such as correctness, style, complexity and perf, and you can allow or deny them per crate or per line. It runs on every platform the Rust toolchain supports.
Because it installs with rustup, there is no separate setup step. Many lints support automatic fixes through `cargo clippy --fix`, which applies suggestions in place. You can enforce a clean run in CI with `-D warnings`. The main limit is that Clippy only ships lints the Rust project accepts, so team-specific rules need another tool.
Pros
Ships with rustup
hundreds of built-in lints
works with cargo fix
Cons
Some lints are opinionated
custom rules require upstream changes
Price: Free (open source), as listed by the vendor (Clippy website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: some lints are opinionated.
Verdict. A sensible pick for general-purpose lints for everyday Rust code.
02
cargo-deny
Best for: Dependency licence, advisory and duplicate checks
cargo-deny is a Cargo plugin from Embark Studios that audits your dependency graph. It has four check categories: licences, security advisories, bans on specific crates or duplicate versions, and allowed registry sources. Configuration lives in a `deny.toml` file, so policy is versioned with the repository.
It runs on Linux, macOS and Windows and is typically wired into CI as a separate job. It reads the RustSec advisory database for vulnerability checks. The tool does not lint your own code; it governs what you depend on. Teams with strict licence or supply-chain policies get the most value from it. Smaller projects may find the config overhead higher than the benefit.
Pros
Checks licences, advisories, bans and sources in one config
good CI output
Cons
Config file has a learning curve
not a source-code linter
Price: Free (open source), as listed by the vendor (cargo-deny website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: config file has a learning curve.
Verdict. A sensible pick for dependency licence, advisory and duplicate checks.
03
cargo-audit
Best for: Checking dependencies against security advisories
cargo-audit is part of the RustSec project and scans your `Cargo.lock` against the RustSec Advisory Database. A single `cargo audit` command reports vulnerable dependencies with advisory IDs and suggested fixed versions. It runs on all major platforms and is easy to add to CI.
The scope is deliberately narrow: it reports known advisories, not general code quality. It does not check licences or duplicate crates, which is where cargo-deny goes further. For a quick security gate on a small project, cargo-audit is the lighter option. Projects that already use cargo-deny may not need both, since cargo-deny includes advisory checking.
Pros
Simple one-command advisory scan
uses the RustSec database
Cons
Only covers known advisories
no licence or duplicate checks
Price: Free (open source), as listed by the vendor (cargo-audit website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: only covers known advisories.
Verdict. A sensible pick for checking dependencies against security advisories.
04
dylint
Best for: Teams that need custom lint rules
dylint from Trail of Bits is a tool for running custom Rust lints. You build lint rules as dynamic libraries and dylint loads them alongside the standard compiler lints. This lets a team enforce project-specific rules, such as banning a particular API or requiring a pattern, without waiting for Clippy to accept an upstream lint.
It runs where the Rust toolchain runs. Because lints are compiled against compiler internals, they are tied to specific nightly or pinned toolchain versions, which adds maintenance work. It suits larger teams with rules that Clippy cannot express. Small projects and solo developers rarely need it.
Pros
Write lints as separate crates
load them without forking Clippy
Cons
Requires writing Rust lint code
tied to specific toolchain versions
Price: Free (open source), as listed by the vendor (dylint website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: requires writing Rust lint code.
Verdict. A sensible pick for teams that need custom lint rules.
05
rustfmt
Best for: Enforcing consistent code formatting
rustfmt is the official Rust code formatter, installed with rustup. It is not a linter in the strict sense, but it enforces a consistent style and removes a whole class of review comments. Running `cargo fmt --check` in CI fails the build when code is not formatted, which keeps diffs clean.
It handles stable formatting options through a `rustfmt.toml` file. Some configuration options are only available on nightly, which matters if you want stricter control. It runs on all supported platforms. Pair it with Clippy: rustfmt handles layout, Clippy handles logic and style lints.
Pros
Official formatter
check mode for CI
configurable via rustfmt.toml
Cons
Formatting only, not logic lints
some options need nightly
Price: Free (open source), as listed by the vendor (rustfmt website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: formatting only, not logic lints.
Verdict. A sensible pick for enforcing consistent code formatting.
06
cargo-machete
Best for: Finding unused dependencies in Cargo.toml
cargo-machete scans your `Cargo.toml` and source files to find dependencies that are declared but never used. Removing them shrinks build times and the dependency surface. It runs as a Cargo subcommand on Linux, macOS and Windows.
The analysis is heuristic: it looks for crate names in source, so macros, re-exports or build scripts can cause false positives. It supports an ignore list for known cases. It does not check licences or advisories. Use it alongside cargo-deny or cargo-audit rather than as a replacement.
Pros
Fast unused-dependency detection
simple CLI and CI use
Cons
Heuristic analysis can produce false positives
narrow scope
Price: Free (open source), as listed by the vendor (cargo-machete website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: heuristic analysis can produce false positives.
Verdict. A sensible pick for finding unused dependencies in Cargo.toml.
07
semgrep
Best for: Custom pattern-based rules across languages
Semgrep is a pattern-based static analysis tool with Rust support. You write rules in YAML to match code patterns, which lets teams enforce conventions Clippy does not cover. It runs as a CLI on Linux, macOS and Windows and integrates with CI systems.
The open-source CLI is free. Team and enterprise features, such as centralized rule management and dashboards, are on paid tiers; check the vendor pricing page for current numbers. Rust parsing is less mature than for languages like Python or JavaScript, so some patterns may not match as expected. It is a complement to Clippy, not a replacement.
Pros
Supports Rust plus many other languages
custom rules in YAML
Cons
Rust support is less deep than Clippy
paid tiers for team features
Price: See vendor pricing page, as listed by the vendor (semgrep website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: rust support is less deep than Clippy.
Verdict. A sensible pick for custom pattern-based rules across languages.
Who should use what
A solo developer starting a Rust project should enable Clippy and rustfmt, both installed with rustup, and add `cargo clippy -D warnings` and `cargo fmt --check` to CI. A team shipping a library with licence obligations should add cargo-deny with a `deny.toml` policy. A security-focused team should run cargo-audit or cargo-deny's advisory check on every build. A large organization with house rules that Clippy cannot express should look at dylint, and anyone tidying a bloated `Cargo.toml` should run cargo-machete.
What to check before you buy
Confirm the tool runs on your target platforms and Rust toolchain version.
Check whether it lints your source code, your dependencies, or both.
Verify CI integration and exit codes so failures actually block merges.
Review licence and advisory policy options if you ship binaries or libraries.
Confirm the tool runs locally and does not send source code to a third party.
FAQ
Is Clippy a linter or a compiler plugin?
Clippy is a linter built on the Rust compiler's lint infrastructure. It runs through Cargo as `cargo clippy` and reports lints grouped by level. It is installed with rustup and needs no separate download.
Do I need cargo-deny and cargo-audit together?
Not necessarily. cargo-deny includes advisory checking plus licence, ban and source rules. cargo-audit is a simpler single-purpose advisory scan. Many projects use cargo-deny alone; smaller projects may prefer cargo-audit for its lower setup cost.
Can these linters run offline?
Yes. Clippy, rustfmt, cargo-audit, cargo-deny, dylint and cargo-machete run locally. Advisory checks need an updated database, which cargo-audit and cargo-deny can fetch and cache. No source code is uploaded to a third-party service.
Does rustfmt count as a linter?
rustfmt is a formatter, not a logic linter. It enforces consistent layout and can fail CI with `--check`. Most teams run it alongside Clippy because the two cover different problems.
How do I enforce lints in CI?
Run `cargo clippy -- -D warnings` and `cargo fmt --check` as CI steps, and add cargo-deny or cargo-audit as a separate job. Pin the toolchain version so lint results stay stable across builds.