rust-review-patterns
Rust Code Review Patterns
Overview
Rust's ownership model, borrow checker, and zero-cost abstractions create a category of correctness guarantees absent from other systems languages. A reviewer familiar with C++ or Go will miss the failure modes that are unique to Rust: unnecessary clone chains that silently degrade throughput, lifetime annotations that fight the compiler rather than express intent, unsafe blocks that document no invariants, and async code that compiles but deadlocks under real workloads.
This guide focuses on seven areas where Rust code most commonly fails in review or in production: ownership and borrowing discipline, lifetime annotations, unsafe correctness, error handling with Result and Option, async pitfalls around Send and Sync, trait design mistakes, and pervasive anti-patterns like excessive cloning and Arc<Mutex<>> overuse.
Load this skill when reviewing any Rust PR that touches async runtimes, FFI boundaries, public library APIs, or performance-sensitive hot paths. Cross-reference review-accuracy-calibration before posting: Rust's compiler rejects most memory safety bugs, but logic errors in unsafe blocks, async cancellation, and error propagation escape static analysis.