Rules
Rules Overview
All 19 custom AST rules organized by category, plus 700+ clippy lints.
Custom AST rules
rust-doctor includes 19 custom rules that analyze the AST via syn. These detect issues that clippy and the Rust compiler cannot catch.
| Category | Rule | Severity |
|---|---|---|
| Error Handling | unwrap-in-production | Warning |
| Error Handling | panic-in-library | Error |
| Error Handling | box-dyn-error-in-public-api | Warning |
| Error Handling | result-unit-error | Warning |
| Performance | excessive-clone | Warning |
| Performance | string-from-literal | Info |
| Performance | collect-then-iterate | Warning |
| Performance | large-enum-variant | Warning |
| Performance | unnecessary-allocation | Warning |
| Architecture | high-cyclomatic-complexity | Warning |
| Security | hardcoded-secrets | Error |
| Security | unsafe-block-audit | Warning |
| Security | sql-injection-risk | Error |
| Async | blocking-in-async | Error |
| Async | block-on-in-async | Error |
| Framework | tokio-main-missing | Error |
| Framework | tokio-spawn-without-move | Error |
| Framework | axum-handler-not-async | Warning |
| Framework | actix-blocking-handler | Warning |
Clippy lints
rust-doctor runs clippy internally with 700+ lints and applies severity overrides and category mapping. Lints not in the built-in registry inherit clippy defaults and map to the Style category.
Framework-specific rules
Framework and async rules are conditionally enabled based on your project's dependencies. If your project doesn't use tokio, axum, or actix-web, those rules are automatically skipped.