RustFix

iriyaverma@iriyaverma

Paste Rust compiler errors and get plain-English explanations with fixes — covers borrow checker, lifetimes, traits, types, macros, async, and more.

Readme

openclaw-rustfix

Paste Rust compiler errors and get plain-English explanations with fixes — covers borrow checker, lifetimes, traits, types, macros, async, and more.

Created by Riya Verma.


Installation

text
openclaw plugins install openclaw-rustfix

What it does

RustFix turns cryptic rustc errors into human-readable explanations with concrete fixes. It covers 25+ of the most common Rust compiler errors across every major category:

CategoryExamples
Borrow checkerE0502 (mutable + immutable borrow), E0499 (double mutable borrow)
Move semanticsE0382 (use after move), E0505 (move while borrowed), E0507 (move from shared ref)
LifetimesE0106 (missing lifetime), E0597 (doesn't live long enough), E0515 (returning local ref)
TraitsE0277 (trait not satisfied), E0599 (method not found), E0038 (object safety)
TypesE0308 (mismatched types), E0061 (wrong arg count)
AsyncE0728 (await outside async), future not Send
ImportsE0425 (not in scope), E0432 (unresolved import), E0433 (undeclared crate)
UnsafeE0133 (unsafe block required)
PatternsE0004 (non-exhaustive match)
MacrosE0658 (unstable feature)

Agent tools

rust_fix

Paste raw cargo build or rustc output. The plugin parses all errors, looks them up, and returns:

  • What went wrong (plain English)
  • How to fix it (multiple options)
  • Before/after code examples
  • Link to the official docs

Example prompt: "Fix this Rust error: error[E0382]: use of moved value: s"

rust_explain

Look up a specific error code and get the full breakdown.

Example prompt: "Explain Rust error E0502"

rust_errors

Browse all known errors by category.

Example prompt: "Show me all Rust borrow checker errors"

Auto-detection

RustFix hooks into tool outputs — if any tool returns text containing error[E0xxx], the plugin automatically appends explanations and fixes. No manual pasting needed.

CLI

bash
openclaw rustfix errors                   # list all known errors
openclaw rustfix errors -c borrow         # filter by category
openclaw rustfix lookup E0382             # look up a specific code
openclaw rustfix categories               # list error categories

Running tests

bash
npm test

37 tests covering the error database, parser, and formatter.

License

MIT