Anti-patterns & Footguns

Anti-patterns and footguns are Rust habits that compile but undermine Rust’s guarantees, clarity, performance, or error behavior; the cure is usually to move intent into ownership, types, pattern matching, and explicit failure paths.

Concepts

Patterns

Antipatterns

Reading Path

Start with Needless Clone, Index Panics vs get, and Is Some Then Unwrap for local code smells. Then read Stringly-Typed Code, Sentinel Values, and Integer Overflow Assumptions for type-system design habits. Finish with Rc RefCell Overuse, Premature Arc Mutex, Blocking in Async, and Deref Polymorphism Antipattern for architecture-level footguns.

Sources