Summary
Add Rust language support. AI tools frequently generate incorrect Rust code because of its strict ownership/borrowing rules.
Unique Rust patterns to detect
Ownership & Borrowing (AI struggles with these)
clone() overuse — AI clones everything instead of borrowing
- Unnecessary
unsafe blocks
- Raw pointer usage where safe Rust works
&mut aliasing violations
- Missing lifetime annotations
Security
unsafe blocks with dangerous operations
unwrap() / expect() on user input — panics in production
todo!(), unimplemented!() — incomplete code
- Command injection via
std::process::Command
- Hardcoded secrets
Hallucinations
- Non-existent crates (cross-reference crates.io popular crates)
- Invented trait implementations
- Fake
std API methods
- Wrong derive macros
Logic
- Dead code from unused variables (Rust compiler catches this, but AI may disable the lint)
match arms that are unreachable
- Incorrect
Result/Option handling patterns
Approach
Pattern-based regex analysis. Rust has very consistent syntax which makes this feasible.
Acceptance Criteria
Difficulty
Advanced — requires understanding of Rust's ownership model to create meaningful checks.
Summary
Add Rust language support. AI tools frequently generate incorrect Rust code because of its strict ownership/borrowing rules.
Unique Rust patterns to detect
Ownership & Borrowing (AI struggles with these)
clone()overuse — AI clones everything instead of borrowingunsafeblocks&mutaliasing violationsSecurity
unsafeblocks with dangerous operationsunwrap()/expect()on user input — panics in productiontodo!(),unimplemented!()— incomplete codestd::process::CommandHallucinations
stdAPI methodsLogic
matcharms that are unreachableResult/Optionhandling patternsApproach
Pattern-based regex analysis. Rust has very consistent syntax which makes this feasible.
Acceptance Criteria
.rsfiles auto-detected and analyzedclone()overuse detectionunsafeblock analysisunwrap()on user input detectionDifficulty
Advanced — requires understanding of Rust's ownership model to create meaningful checks.