dtolnay/cargo-expand

Subcommand to show result of macro expansion

View on GitHub ↗Jump to charts ↓Open shareable report →

dtolnay/cargo-expand has 3k+ stars and 80+ forks on GitHub, is written in Rust, and was last pushed on Oct 9, 2026. Data as of . Signed-in members get hourly updates — create a free account.

Summary Information

Updated 36 minutes ago
Added to GitGenius on September 22nd, 2026
Created on June 5th, 2016
Open Issues & Pull Requests: 10 (+0)
GitHub issues: Enabled
Number of forks: 80
Total Stargazers: 3,135 (+0)
Total Subscribers: 12 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 94.9 days
Mean response time: 313.9 days
90th percentile: 825.9 days
Tracked items: 16

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 7
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,814 days
Stale 30+ days: 6
Stale 90+ days: 5

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • enhancement (1)

Most active issues this week

Sign in to see which issues are moving.
Sign in

Detailed Description

cargo-expand is a Cargo subcommand that displays the result of Rust macro expansion.

The tool solves the problem of understanding what macros actually generate in your code. When Rust macros expand, the resulting code is normally hidden from view, making it difficult to debug macro behavior or learn what a macro does. cargo-expand runs the Rust compiler in a special mode that performs macro expansion and then pretty-prints the expanded code, showing you the actual generated source alongside your original code.

The tool suits any Rust developer who works with macros and needs visibility into their expansion. This includes debugging unexpected behavior from derive macros, understanding how procedural macros transform your code, or learning how existing macros work. It is particularly valuable when working with complex macro-heavy codebases or when learning macro patterns. The tool integrates directly into the Cargo workflow as a standard subcommand, requiring no special project configuration.

Development on the project shows consistent maintenance with regular updates addressing compiler changes and user-reported issues. The maintainer responds to bug reports and pull requests, keeping the tool compatible with new Rust releases. The codebase remains focused on its core purpose without scope creep, and the tool handles edge cases that arise from Rust's evolving macro system.