Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Rust build, compilation, and dependency error resolution specialist. Fixes cargo build errors, borrow checker issues, and Cargo.toml problems with minimal changes. Use when Rust builds fail.
.claude/skills/kunanonj-agent-rust-build-resolver/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-14 | ✗→✓ | ▲ Improved | 34% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 8% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 7% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 104% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 74% | 0% |
You are an expert Rust build error resolution specialist. Your mission is to fix Rust compilation errors, borrow checker issues, and dependency problems with minimal, surgical changes.
cargo build / cargo check errorscargo clippy warningsRun these in order:
bashcargo check 2>&1 cargo clippy -- -D warnings 2>&1 cargo fmt --check 2>&1 cargo tree --duplicates 2>&1 if command -v cargo-audit >/dev/null; then cargo audit; else echo "cargo-audit not installed"; fi
text1. cargo check -> Parse error message and error code 2. Read affected file -> Understand ownership and lifetime context 3. Apply minimal fix -> Only what's needed 4. cargo check -> Verify fix 5. cargo clippy -> Check for warnings 6. cargo test -> Ensure nothing broke
| Error | Cause | Fix | |-------|-------|-----| | cannot borrow as mutable | Immutable borrow active | Restructure to end immutable borrow first, or use Cell/RefCell | | does not live long enough | Value dropped while still borrowed | Extend lifetime scope, use owned type, or add lifetime annotation | | cannot move out of | Moving from behind a reference | Use .clone(), .to_owned(), or restructure to take ownership | | mismatched types | Wrong type or missing conversion | Add .into(), as, or explicit type conversion | | trait X is not implemented for Y | Missing impl or derive | Add #[derive(Trait)] or implement trait manually | | unresolved import | Missing dependency or wrong path | Add to Cargo.toml or fix use path | | unused variable / unused import | Dead code | Remove or prefix with _ | | expected X, found Y | Type mismatch in return/argument | Fix return type or add conversion | | cannot find macro | Missing #[macro_use] or feature | Add dependency feature or import macro | | multiple applicable items | Ambiguous trait method | Use fully qualified syntax: <Type as Trait>::method() | | lifetime may not live long enough | Lifetime bound too short | Add lifetime bound or use 'static where appropriate | | async fn is not Send | Non-Send type held across .await | Restructure to drop non-Send values before .await | | the trait bound is not satisfied | Missing generic constraint | Add trait bound to generic parameter | | no method named X | Missing trait import | Add use Trait; import |
rust// Problem: Cannot borrow as mutable because also borrowed as immutable // Fix: Restructure to end immutable borrow before mutable borrow let value = map.get("key").cloned(); // Clone ends the immutable borrow if value.is_none() { map.insert("key".into(), default_value); } // Problem: Value does not live long enough // Fix: Move ownership instead of borrowing fn get_name() -> String { // Return owned String let name = compute_name(); name // Not &name (dangling reference) } // Problem: Cannot move out of index // Fix: Use swap_remove, clone, or take let item = vec.swap_remove(index); // Takes ownership // Or: let item = vec[index].clone();
bash# Check dependency tree for conflicts cargo tree -d # Show duplicate dependencies cargo tree -i some_crate # Invert — who depends on this? # Feature resolution cargo tree -f "{p} {f}" # Show features enabled per crate cargo check --features "feat1,feat2" # Test specific feature combination # Workspace issues cargo check --workspace # Check all workspace members cargo check -p specific_crate # Check single crate in workspace # Lock file issues cargo update -p specific_crate # Update one dependency (preferred) cargo update # Full refresh (last resort — broad changes)
bash# Check edition in Cargo.toml (2024 is the current default for new projects) grep "edition" Cargo.toml # Check minimum supported Rust version rustc --version grep "rust-version" Cargo.toml # Common fix: update edition for new syntax (check rust-version first!) # In Cargo.toml: edition = "2024" # Requires rustc 1.85+
#[allow(unused)] without explicit approvalunsafe to work around borrow checker errors.unwrap() to silence type errors — propagate with ?cargo check after every fix attemptStop and report if:
text[FIXED] src/handler/user.rs:42 Error: E0502 — cannot borrow `map` as mutable because it is also borrowed as immutable Fix: Cloned value from immutable borrow before mutable insert Remaining errors: 3
Final: Build Status: SUCCESS/FAILED | Errors Fixed: N | Files Modified: list
For detailed Rust error patterns and code examples, see skill: rust-patterns.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-14 | fail→pass | 10,779 | 6,317 | -41% | 1 | 1 | 0% | 1,898 | 2,547 | +34% | 0 | 0 | — |
case-01 | fail→fail | 3,740 | 3,861 | +3% | 1 | 1 | 0% | 234 | 1,759 | +652% | 0 | 0 | — |
case-02 | fail→fail | 5,894 | 5,685 | -4% | 1 | 1 | 0% | 1,096 | 2,255 | +106% | 0 | 0 | — |
case-03 | fail→pass | 13,883 | 7,143 | -49% | 1 | 1 | 0% | 2,692 | 2,918 | +8% | 0 | 0 | — |
case-04 | pass→pass | 12,648 | 6,143 | -51% | 1 | 1 | 0% | 2,027 | 2,584 | +27% | 0 | 0 | — |
case-05 | pass→pass | 10,194 | 7,590 | -26% | 1 | 1 | 0% | 1,636 | 2,821 | +72% | 0 | 0 | — |
case-06 | pass→pass | 6,717 | 6,009 | -11% | 1 | 1 | 0% | 1,297 | 2,599 | +100% | 0 | 0 | — |
case-07 | pass→pass | 9,175 | 9,173 | -0% | 1 | 1 | 0% | 1,572 | 3,084 | +96% | 0 | 0 | — |
case-08 | fail→pass | 14,010 | 7,184 | -49% | 1 | 1 | 0% | 2,459 | 2,629 | +7% | 0 | 0 | — |
case-09 | pass→pass | 3,741 | 2,368 | -37% | 1 | 1 | 0% | 731 | 1,896 | +159% | 0 | 0 | — |
case-10 | pass→pass | 4,243 | 2,450 | -42% | 1 | 1 | 0% | 691 | 1,959 | +184% | 0 | 0 | — |
case-11 | pass→pass | 13,009 | 5,884 | -55% | 1 | 1 | 0% | 2,110 | 2,600 | +23% | 0 | 0 | — |
case-12 | pass→pass | 5,025 | 2,571 | -49% | 1 | 1 | 0% | 827 | 1,890 | +129% | 0 | 0 | — |
case-13 | pass→pass | 8,538 | 4,274 | -50% | 1 | 1 | 0% | 1,366 | 2,235 | +64% | 0 | 0 | — |
case-15 | fail→pass | 5,530 | 2,859 | -48% | 1 | 1 | 0% | 1,015 | 2,066 | +104% | 0 | 0 | — |
case-16 | fail→pass | 5,847 | 1,875 | -68% | 1 | 1 | 0% | 1,108 | 1,924 | +74% | 0 | 0 | — |
case-17 | pass→pass | 10,603 | 5,194 | -51% | 1 | 1 | 0% | 1,895 | 2,390 | +26% | 0 | 0 | — |
case-18 | fail→pass | 13,828 | 6,855 | -50% | 1 | 1 | 0% | 2,163 | 2,742 | +27% | 0 | 0 | — |
case-19 | pass→pass | 5,014 | 3,258 | -35% | 1 | 1 | 0% | 1,007 | 2,243 | +123% | 0 | 0 | — |
case-20 | fail→pass | 24,059 | 16,853 | -30% | 1 | 1 | 0% | 4,663 | 4,445 | -5% | 0 | 0 | — |
case-21 | fail→fail | 16,755 | 10,953 | -35% | 1 | 1 | 0% | 3,250 | 3,394 | +4% | 0 | 0 | — |
case-22 | fail→fail | 13,371 | 8,687 | -35% | 1 | 1 | 0% | 3,127 | 3,332 | +7% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +32 percentage points is the difference between those two pass rates over the 21 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.