dtolnay/cargo-expand
Subcommand to show result of macro expansion observed · 2026-08-28
Health v2 · maintenance only
98/100
- Activity 98
- Release rhythm 98
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: 10.0
- age_days: 3741
- days_rel: 14
- days_push: 14
- n_releases_24m: 35
Adoption not part of the score
3126 stars · 78 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A Cargo subcommand that prints the result of macro and #[derive] expansion for a Rust crate, wrapping the verbose `cargo rustc -- -Zunpretty=expanded` compiler command. It optionally formats the expanded output with rustfmt for readability.
Use cases
- debug why a Rust macro isn't working
- see what #[derive] generates for my struct
- inspect expanded proc macro output
- understand what code a macro produces
- troubleshoot macro expansion in Rust
When to choose
- you're developing or debugging Rust macros or proc macros
- you need to see the fully expanded code the compiler sees
- you want formatted, readable expansion output
When to avoid
- you don't work with Rust or Cargo
- you need a general-purpose Rust debugger rather than macro inspection
Facets
cli-tool · maturity stable
developer-tools compiler documentation developer-tools programming-languages cli rust cross-platform cargo-subcommand rust-macros macro-expansion debugging command-line
2 sources
- readme: https://github.com/dtolnay/cargo-expand · fetched 2026-08-28 · 140c5cb03d10
- registry_crates: https://crates.io/api/v1/crates/cargo-expand · fetched 2026-08-29 · fbb89abeed24
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| dtolnay/cargo-expand | main | 98 |
For agents
markdown · JSON · MCP: product_card(name="dtolnay/cargo-expand")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem