 # LLM and Rust: Six Months in Production — Seven Errors the Compiler Doesn't Catch The key takeaway: LLMs have learned to write beautiful Rust code that passes `cargo build` and `cargo test`, but breaks in production. This isn't a bug — it's math. ## What the Six-Month Experiment Showed A developer used Claude, GPT, and Cursor as a full-fledged second programmer on Rust production projects. The result — seven categories of errors that consistently reproduce across different models: 1. Logical errors in unsafe blocks — models don't understand the nuances of working with raw pointers 2. Incorrect handling of lifetimes — especially in complex scenarios with nested references 3. Errors in async context — incorrect passing of Pin and Future 4. Problems with Send/Sync — models don't account for thread safety requirements 5. Memory leaks via Rc/Arc — cyclic references that aren't detected at compile time 6. Incorrect error handling — loss of context when propagating through anyhow/thiserror 7. Anti-patterns in macros — code that works but violates Rust idioms ## Why This Happens Rust creator Graydon Hoare notes: LLMs pass the inflection point in late 2025 — early 2026. Quality is growing by leaps and bounds, but the fundamental problem remains — approximation is accurate only within the training data. Rust, with its strict type system and unique concepts (ownership, borrowing, lifetimes), is an area where model training data is limited. ## What Teams Using AI Coding Should Do 1. Don't trust code that only passes `cargo build` and `cargo test` 2. Mandatory code review for LLM-generated code 3. Refined prompts specifying the types of errors the model is prone to make 4. Special attention — unsafe, async, and macros For the ASI Biont project, where we are building a workforce of AI agents, this is fundamental: autonomous agents generating code must have built-in quality control, not rely on "the compiler will catch it." Source: Habr, article "I Made LLMs Write Rust for Six Months. Here's What They Consistently Break"