Generated catalog · 125 rules
Rust Doctor rules
Canonical metadata from the Rust Doctor binary. Each page exposes activation, evidence limits, framework requirements, and remediation guidance.
Download the machine-readable catalogFramework
7 rules- actix-blocking-handler Flags blocking calls (`std::thread::sleep`, `std::fs::*`, `std::net::*`) in actix-web handler functions. Web framework handlers run on the async runtime and must not block. rust-doctor · warning
- actix-web-data-lock Detect blocking shared-state locks inside actix-web handlers rust-doctor · warning · opt-in
- axum-extension-request-state Detect Axum Extension used for application-wide state rust-doctor · warning · opt-in
- axum-handler-not-async Flags non-async handler functions in axum. Web framework handlers run on the async runtime and must not block. rust-doctor · warning
- tokio-main-missing Flags `async fn main()` without `#[tokio::main]` (or equivalent runtime attribute). Without it, the async runtime is not initialized and the program won't compile or will panic. rust-doctor · error
- tokio-spawn-without-move Flags `tokio::spawn(async { ... })` without the `move` keyword. Without `move`, the spawned task borrows from the enclosing scope, which often fails to compile due to lifetime requirements ('static bound on spawn). rust-doctor · error
- tokio-unbounded-channel Detect Tokio unbounded channels without backpressure rust-doctor · warning · opt-in
Async
9 rules- await-holding-refcell-ref Detect RefCell borrows retained across an await point rust-doctor · warning · opt-in
- block-on-in-async Flags `Runtime::block_on()` or `futures::executor::block_on()` called inside `async fn`. This blocks the current thread waiting for a future, which can deadlock the runtime if all worker threads are blocked. rust-doctor · error
- blocking-in-async Flags blocking `std` calls inside `async fn`: `std::thread::sleep`, `std::fs::*`, `std::net::*`. These block the async runtime's thread pool, reducing concurrency and potentially causing deadlocks. rust-doctor · error
- blocking-lock-in-async Detect blocking mutex acquisition inside async functions rust-doctor · warning · opt-in
- clippy::await_holding_lock Clippy `await_holding_lock` diagnostic clippy · error
- clippy::await_holding_refcell_ref Clippy `await_holding_refcell_ref` diagnostic clippy · error
- clippy::redundant_async_block Clippy `redundant_async_block` diagnostic clippy · warning
- clippy::unused_async Clippy `unused_async` diagnostic clippy · warning
- spawn-in-drop Detect Tokio task spawning from Drop implementations rust-doctor · warning · opt-in
Error Handling
18 rules- box-dyn-error-in-public-api Flags `pub fn` returning `Result<_, Box<dyn Error>>`. This erases error type information, making it impossible for callers to match on specific error variants. rust-doctor · warning
- clippy::exit Clippy `exit` diagnostic clippy · warning
- clippy::expect_used Clippy `expect_used` diagnostic clippy · warning
- clippy::indexing_slicing Clippy `indexing_slicing` diagnostic clippy · warning
- clippy::let_underscore_must_use Clippy `let_underscore_must_use` diagnostic clippy · warning
- clippy::manual_ok_or Clippy `manual_ok_or` diagnostic clippy · warning
- clippy::map_unwrap_or Clippy `map_unwrap_or` diagnostic clippy · warning
- clippy::option_if_let_else Clippy `option_if_let_else` diagnostic clippy · warning
- clippy::panic Clippy `panic` diagnostic clippy · warning
- clippy::panic_in_result_fn Clippy `panic_in_result_fn` diagnostic clippy · warning
- clippy::question_mark Clippy `question_mark` diagnostic clippy · warning
- clippy::result_large_err Clippy `result_large_err` diagnostic clippy · warning
- clippy::result_unit_err Clippy `result_unit_err` diagnostic clippy · warning
- clippy::unwrap_in_result Clippy `unwrap_in_result` diagnostic clippy · warning
- clippy::unwrap_used Clippy `unwrap_used` diagnostic clippy · warning
- panic-in-library Flags `panic!()`, `todo!()`, and `unimplemented!()` macros in library code. Libraries should return errors rather than panicking, since callers cannot recover from a panic across crate boundaries. rust-doctor · error
- result-unit-error Flags `pub fn` returning `Result<_, ()>`. A unit error carries no information about what went wrong. rust-doctor · warning
- unwrap-in-production Flags `.unwrap()` and `.expect()` calls outside of test code. These calls panic at runtime if the value is `None` or `Err`, crashing your application. rust-doctor · warning
Correctness
21 rules- catch-unwind-discarded Detect panic payloads discarded after catch_unwind rust-doctor · warning · opt-in
- clippy::absurd_extreme_comparisons Clippy `absurd_extreme_comparisons` diagnostic clippy · error
- clippy::almost_swapped Clippy `almost_swapped` diagnostic clippy · error
- clippy::approx_constant Clippy `approx_constant` diagnostic clippy · error
- clippy::bad_bit_mask Clippy `bad_bit_mask` diagnostic clippy · error
- clippy::cast_lossless Clippy `cast_lossless` diagnostic clippy · warning
- clippy::cast_possible_wrap Clippy `cast_possible_wrap` diagnostic clippy · warning
- clippy::cast_sign_loss Clippy `cast_sign_loss` diagnostic clippy · warning
- clippy::eq_op Clippy `eq_op` diagnostic clippy · error
- clippy::float_cmp Clippy `float_cmp` diagnostic clippy · warning
- clippy::invalid_regex Clippy `invalid_regex` diagnostic clippy · error
- clippy::match_overlapping_arm Clippy `match_overlapping_arm` diagnostic clippy · warning
- clippy::wrong_self_convention Clippy `wrong_self_convention` diagnostic clippy · warning
- compiler-error Finding reported by rustc rustc · error
- compiler-ice Finding reported by rustc rustc · error
- low-coverage Finding reported by cargo-llvm-cov cargo-llvm-cov · warning
- mem-forget-resource Detect resource guards passed to mem::forget rust-doctor · warning · opt-in
- process-exit-in-library Detect process termination from library source rust-doctor · warning · opt-in
- semver-violation Finding reported by cargo-semver-checks cargo-semver-checks · error
- uncovered-file Finding reported by cargo-llvm-cov cargo-llvm-cov · warning
- unknown-rustc-level Finding reported by rustc rustc · info
Performance
23 rules- clippy::box_collection Clippy `box_collection` diagnostic clippy · warning
- clippy::clone_on_copy Clippy `clone_on_copy` diagnostic clippy · warning
- clippy::cloned_instead_of_copied Clippy `cloned_instead_of_copied` diagnostic clippy · warning
- clippy::cmp_owned Clippy `cmp_owned` diagnostic clippy · warning
- clippy::inefficient_to_string Clippy `inefficient_to_string` diagnostic clippy · warning
- clippy::large_enum_variant Clippy `large_enum_variant` diagnostic clippy · warning
- clippy::large_futures Clippy `large_futures` diagnostic clippy · warning
- clippy::large_stack_arrays Clippy `large_stack_arrays` diagnostic clippy · warning
- clippy::needless_collect Clippy `needless_collect` diagnostic clippy · warning
- clippy::or_fun_call Clippy `or_fun_call` diagnostic clippy · warning
- clippy::redundant_clone Clippy `redundant_clone` diagnostic clippy · warning
- clippy::single_char_pattern Clippy `single_char_pattern` diagnostic clippy · warning
- clippy::suboptimal_flops Clippy `suboptimal_flops` diagnostic clippy · warning
- clippy::trivially_copy_pass_by_ref Clippy `trivially_copy_pass_by_ref` diagnostic clippy · warning
- clippy::unnecessary_to_owned Clippy `unnecessary_to_owned` diagnostic clippy · warning
- clippy::useless_vec Clippy `useless_vec` diagnostic clippy · warning
- collect-then-iterate Flags `.collect::<Vec<_>>()` immediately followed by `.iter()`. This allocates a temporary vector unnecessarily since the original iterator could be used directly. rust-doctor · warning
- excessive-clone Flags `.clone()` calls that may indicate unnecessary heap allocations. Each clone copies the entire value, which is expensive for `String`, `Vec`, and other heap-allocated types. rust-doctor · warning
- large-enum-variant Flags enums where variants have significantly different sizes (>3x field count disparity). The enum's size equals its largest variant, wasting memory for smaller variants. rust-doctor · warning
- regex-created-in-loop Detect regular expressions compiled inside loops rust-doctor · warning · opt-in
- string-from-literal Flags `String::from("literal")` and `"literal".to_string()`. These allocate on the heap when a `&str` reference might suffice. rust-doctor · info · opt-in
- unbounded-collect Detect input-like iterators collected without an explicit bound rust-doctor · warning · opt-in
- unnecessary-allocation Flags `Vec::new()` or `String::new()` inside loops. Each iteration allocates a new buffer, which is expensive. rust-doctor · warning
Cargo
12 rules- clippy::cargo_common_metadata Clippy `cargo_common_metadata` diagnostic clippy · warning
- clippy::multiple_crate_versions Clippy `multiple_crate_versions` diagnostic clippy · warning
- clippy::negative_feature_names Clippy `negative_feature_names` diagnostic clippy · warning
- clippy::redundant_feature_names Clippy `redundant_feature_names` diagnostic clippy · warning
- clippy::wildcard_dependencies Clippy `wildcard_dependencies` diagnostic clippy · error
- deny-ban Finding reported by cargo-deny cargo-deny · error
- deny-license Finding reported by cargo-deny cargo-deny · warning
- deny-source Finding reported by cargo-deny cargo-deny · warning
- missing-msrv Finding reported by rust-doctor rust-doctor · warning
- msrv-incompatible Finding reported by rust-doctor rust-doctor · error
- msrv-outdated Finding reported by rust-doctor rust-doctor · warning
- skipped-pass Finding reported by rust-doctor rust-doctor · info
Security
15 rules- clippy::cast_possible_truncation Clippy `cast_possible_truncation` diagnostic clippy · warning
- clippy::cast_ptr_alignment Clippy `cast_ptr_alignment` diagnostic clippy · error
- clippy::fn_to_numeric_cast Clippy `fn_to_numeric_cast` diagnostic clippy · warning
- clippy::mem_forget Clippy `mem_forget` diagnostic clippy · warning
- clippy::multiple_unsafe_ops_per_block Clippy `multiple_unsafe_ops_per_block` diagnostic clippy · warning
- clippy::transmute_ptr_to_ref Clippy `transmute_ptr_to_ref` diagnostic clippy · error
- clippy::undocumented_unsafe_blocks Clippy `undocumented_unsafe_blocks` diagnostic clippy · warning
- command-shell-interpolation Detect dynamic input passed through a command shell rust-doctor · warning · opt-in
- hardcoded-secrets Flags string literals assigned to secret-named variables (`api_key`, `password`, `token`, `secret`, …) when the value also looks like a real secret — matching a known key shape (AWS, GitHub, Stripe, JWT) or exceeding a Shannon-entropy threshold. Test code and placeholder values are ignored. Hardcoded secrets can be extracted from compiled binaries or version control. rust-doctor · error
- insecure-http-client Detect non-local plain HTTP transport literals rust-doctor · warning · opt-in
- sql-injection-risk Flags `format!()` output passed to `.query()`, `.execute()`, or `.raw()` methods. String interpolation in SQL queries enables SQL injection attacks. rust-doctor · error
- temporary-cstring-pointer Detect raw pointers borrowed from temporary CString values rust-doctor · warning · opt-in
- unsafe-block-audit Flags `unsafe {}` blocks and `unsafe fn` declarations. Unsafe code bypasses Rust's memory safety guarantees and must be carefully audited. rust-doctor · warning
- unsafe-dependency Finding reported by cargo-geiger cargo-geiger · warning
- weak-crypto-hash Detect weak digests applied directly to secret-like values rust-doctor · warning · opt-in
Architecture
8 rules- clippy::cognitive_complexity Clippy `cognitive_complexity` diagnostic clippy · warning
- clippy::fn_params_excessive_bools Clippy `fn_params_excessive_bools` diagnostic clippy · warning
- clippy::module_name_repetitions Clippy `module_name_repetitions` diagnostic clippy · warning
- clippy::struct_excessive_bools Clippy `struct_excessive_bools` diagnostic clippy · warning
- clippy::too_many_arguments Clippy `too_many_arguments` diagnostic clippy · warning
- clippy::too_many_lines Clippy `too_many_lines` diagnostic clippy · warning
- clippy::type_complexity Clippy `type_complexity` diagnostic clippy · warning
- high-cyclomatic-complexity Function has high cyclomatic complexity — consider refactoring into smaller functions rust-doctor · warning
Style
9 rules- clippy::dbg_macro Clippy `dbg_macro` diagnostic clippy · warning
- clippy::missing_errors_doc Clippy `missing_errors_doc` diagnostic clippy · warning
- clippy::missing_panics_doc Clippy `missing_panics_doc` diagnostic clippy · warning
- clippy::print_stderr Clippy `print_stderr` diagnostic clippy · warning
- clippy::print_stdout Clippy `print_stdout` diagnostic clippy · warning
- clippy::todo Clippy `todo` diagnostic clippy · warning
- clippy::unimplemented Clippy `unimplemented` diagnostic clippy · warning
- clippy::unreachable Clippy `unreachable` diagnostic clippy · warning
- clippy::wildcard_imports Clippy `wildcard_imports` diagnostic clippy · warning