Skip to content
DoCodeHereDeveloper tools and services

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.

By · Published 22 Nov 2026

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

ToolBest forStandout featureListed starting priceFree plan or trial
1 ClippyGeneral-purpose lints for everyday Rust codeShips with rustupFree (open source)Free plan
2 cargo-denyDependency licence, advisory and duplicate checksChecks licences, advisories, bans and sources in one configFree (open source)Free plan
3 cargo-auditChecking dependencies against security advisoriesSimple one-command advisory scanFree (open source)Free plan
4 dylintTeams that need custom lint rulesWrite lints as separate cratesFree (open source)Free plan
5 rustfmtEnforcing consistent code formattingOfficial formatterFree (open source)Free plan
6 cargo-macheteFinding unused dependencies in Cargo.tomlFast unused-dependency detectionFree (open source)Free plan
7 semgrepCustom pattern-based rules across languagesSupports Rust plus many other languagesSee vendor pricing pageFree 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

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.

Sources we checked

  1. cargo-machete (official site)
  2. cargo-machete (official site)
  3. cargo-machete (official site)
  4. cargo-machete (official site)
  5. cargo-machete (official site)
  6. cargo-machete (official site)
  7. semgrep (official site)

Change log. First published 22 Nov 2026.