rust-compiler-errors

Diagnose rustc and cargo error codes and apply fixes that resolve root causes.

2|1|Updated Aug 19, 2026
One-click install
npx skills add https://github.com/po4yka/rust-skills --skill rust-compiler-errors-po4yka
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rust-compiler-errors
Source: https://github.com/po4yka/rust-skills/tree/main/skills/rust-compiler-errors
Command: npx skills add https://github.com/po4yka/rust-skills --skill rust-compiler-errors-po4yka

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Rust compiler errors like E0499, E0502, and E0277 often invite quick fixes such as .clone(), 'static bounds, or RefCell that compile but hide the underlying defect. This Skill maps each borrow checker, lifetime, trait bound, type inference, and unresolved import error to the fix that actually resolves it, and names the reflex fixes that conceal bugs. ## Core Features & Use Cases - Error triage table: Covers E0382, E0499, E0502, E0506, E0507, E0373, E0597, E0716, E0521, E0106, E0277, E0308, E0599, E0282, E0283, E0284, E0425, E0432, E0433, E0038, E0275, E0658, and more, each with a meaning and a first move. - Hazard table of fixes that hide bugs: Explains what .clone(), Box::leak, unsafe, RefCell, and guessed cargo add suggestions conceal, and when each is legitimate. - In-depth references: Worked borrow checker fixes and a complete E0038 dyn compatibility guide mapping every ...because note to its fix. - Use Case: You hit error[E0502]: cannot borrow as mutable because it is also borrowed as immutable. The Skill directs you to copy the value out or split the borrows, and warns against reaching for RefCell before the splits fail. ## Quick Start Ask the AI to diagnose the pasted rustc error E0499 in your function and explain which fix resolves the ownership problem rather than just making it compile.

Frequently Asked Questions about rust-compiler-errors

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix E0499 cannot borrow as mutable more than once in Rust?▼

E0499 means two live mutable borrows point at the same place. Use split_at_mut or get_disjoint_mut for disjoint indices, borrow struct fields instead of self, or scope one borrow. Reach for RefCell only after these splits fail.

How to fix E0502 borrow checker error in Rust?▼

E0502 means a read borrow is live across a write. Copy the value out before mutating, scope the shared borrow in an inner block, or compute decisions under a shared borrow and apply them under an exclusive borrow.

Why does adding .clone() fix E0382 but hide a bug?▼

A clone answers 'both places get one', which is wrong for identities, handles, large buffers, or shared state, and allocates once per loop iteration. Decide the single owner and borrow instead of moving.

What does E0038 trait is not dyn compatible mean?▼

E0038 means one trait item cannot get a vtable slot, such as a method with generic parameters, no self parameter, or a Self return type. Read the ...because note; most items are fixed with a where Self: Sized clause.

Should I run cargo add when rustc suggests it for E0432?▼

Not blindly. rustc suggests cargo add for any unknown first path segment, including modules of your own crate, and a guessed name can be an unrelated or malicious package. Check features, use paths, and Cargo.lock first.

Why does cargo check pass but the build still fail?▼

cargo check stops before monomorphization and linking, so it exits 0 on recursion-limit-during-instantiation and linker errors. Before calling an error fixed, rerun the exact command that failed and the test covering the changed code.