dtolnay/cargo-expand
Subcommand to show result of macro expansion observed · 2026-10-12
Health v2 · maintenance only
99/100
- Activity 99
- Release rhythm 99
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-10-21. Adoption (stars, forks) is never an input.
- gap_med: 10.5
- age_days: 3789
- days_rel: 11
- days_push: 11
- n_releases_24m: 35
Adoption not part of the score
3134 stars · 79 forks observed · 2026-10-12
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-10-12 · 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 | 99 |
For agents
markdown · JSON · MCP: product_card(name="dtolnay/cargo-expand")
Data as of 2026-10-19T08:05:51.212177+00:00 · Report a problem