← ClaudeAtlas

rust-compiler-errorslisted

Use when rustc or cargo reports a numbered error and you need the cause rather than the first fix that compiles. Covers ownership and move errors (E0382, E0505, E0507, E0509), borrow conflicts (E0499, E0502, E0596), lifetime errors (E0597, E0716, E0515, E0521, E0106), trait and type errors (E0038, E0277, E0271, E0308, E0599, E0631, E0275), Drop impl errors (E0184, E0367, E0740), the unnumbered Send error on a future, resolution errors (E0433, E0425, E0603), and layout errors (E0072, E0793). States which reflexive fix hides the bug and which one resolves it. Triggers on any "E0" code that no topic skill owns (E0207 is rust-iterator-impl, E0793 is rust-unsafe, Send and Sync go to rust-send-sync), "borrow checker", "value moved", "does not live long enough", "cannot borrow", "missing lifetime specifier", "trait bound not satisfied", "not dyn compatible", "dyn compatibility", "object safety", "overflow evaluating the requirement", or a paste of a cargo build failure.
po4yka/rust-skills · ★ 2 · Code & Development · score 76
Install: claude install-skill po4yka/rust-skills
# Rust compiler errors ## Purpose Map a compiler error to its cause, then to the fix that resolves it instead of the fix that moves it. Most numbered errors have an obvious escape (`.clone()`, `'static`, `Rc<RefCell<T>>`) that compiles and leaves the real problem in place. This skill names both. ## First moves ```bash # The full explanation, with a worked example. Works offline. rustc --explain E0499 # One line per diagnostic. Use it when the build produces a wall of output. cargo build --message-format=short # Stop at the first failing crate instead of reporting every downstream break. cargo build --keep-going=false # Machine-readable, for counting error codes across a large failure. cargo build --message-format=json 2>/dev/null | grep -o '"code":{"code":"E[0-9]*"' | sort | uniq -c | sort -rn ``` Fix the first error, then rebuild. A single move error produces a cascade of type errors downstream, and most of them disappear on their own. ## Triage table | Code | Message | What it means | First move | | --- | --- | --- | --- | | E0382 | borrow of moved value | The value was consumed, then used again | Decide the owner; borrow instead of moving | | E0505 | cannot move out of `x` because it is borrowed | A live borrow outlives the move | Shorten the borrow, or move before borrowing | | E0507 | cannot move out of `x` which is behind a shared reference | You need ownership but only hold `&` | `mem::take`, `Option::take`, `clone`, or take `self` | | E0509 | cannot move out