Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

rustc

$ rustc Official Low Risk
Rust Foundation · Code & DevOps · MIT / Apache-2.0 · macos / linux / windows

The official Rust compiler frontend and LLVM/Cranelift codegen driver. While multi-crate workspaces use cargo, rustc exposes --error-format=json diagnostics, --emit=metadata fast type-checking, --explain error code lookups, and --print target-list for target introspection.

FCRS-1.0 Score
86 /100
Good
Medium Confidence
Zero-Friction Install
brew install rust
CLI vs MCP Decision CLI Only

Direct local compiler invoked standalone for single files or orchestrated by cargo.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 22 / 25

First-class --error-format=json, --color=never, --print, and --explain flags with zero interactive prompts.

  • Native --error-format=json emits spans and suggested fixes
  • Supports --explain and --print queries
Trust & Safety 22 / 25

Zero network or credential access; purely local compilation with explicit -o output control.

  • Deterministic local execution with no remote side effects
Setup & Portability 13 / 15

Distributed globally via rustup and brew install rust on macOS, Linux, and Windows.

  • Cross-platform rustup toolchain support
Utility & Efficiency 11 / 15

Essential compiler backend, though real multi-file projects should invoke cargo rather than raw rustc.

  • Best suited to single-file checks, target queries, and error explanations
Maintenance & Lineage 10 / 10

Official Rust Foundation compiler with six-week release cadence and strong stability guarantees.

  • Official rust-lang/rust repository
Docs & Verifiability 8 / 10

Dedicated rustc Book and built-in --explain error catalog.

  • Official docs at doc.rust-lang.org/rustc

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

No authentication required; operates strictly on local source files and installed Rust sysroots.

Side Effects
Read-Only Local Write
Cost & Quotas

Dual MIT / Apache-2.0 open-source compiler; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# rustc Agent Rules
- Use `cargo check --message-format=json` for Cargo projects; invoke `rustc` directly only for standalone `.rs` files or `--explain` / `--print` queries.
- Always pass `--error-format=json --color=never` when parsing compiler diagnostics.

Agent-Ready Command Recipes

Safe Read-Only Queries

Look up a Rust compiler error code explanation
rustc --explain E0382

Prints detailed official examples and remediation guidance for a specific compiler error code.

List supported compilation target triples
rustc --print target-list

Outputs all built-in cross-compilation target triples without modifying disk state.

Controlled Writes & Previews

Compile a single Rust file with JSON diagnostics
rustc --error-format=json --color=never main.rs -o build/main

Compiles main.rs to build/main while emitting structured JSON diagnostics on stderr.

Strengths for Agents

  • + --error-format=json delivers exact byte/line spans and machine-applicable fix suggestions.
  • + rustc --explain <CODE> resolves borrow-checker errors offline without web searches.

Caveats & Pitfalls

  • ! Does not resolve external crates from Cargo.toml; use cargo for workspace builds.
  • ! Cross-compiling requires adding the target sysroot via rustup target add.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI