cargo-expand icon indicating copy to clipboard operation
cargo-expand copied to clipboard

Subcommand to show result of macro expansion

Results 19 cargo-expand issues
Sort by recently updated
recently updated
newest added

I find that `cargo expand` is ignoring the `cargo expand path::to::module` syntax. I suspect this is related to #31 and probably because I am using a multi binary crate ---...

https://github.com/dtolnay/cargo-expand/blob/1a43c1c0dbf06f8296144a21b1de181f797c94d2/build.rs#L9-L11

help wanted

Would be good to be able to only expand specific macros and leave other source as is. i.e.: `cargo expand --crate="my-crate-derive"` or `cargo expand --derive=MyTraitA,MyTraitB` at the very least would...

Original idea: https://github.com/dtolnay/trybuild/issues/35 Suggested approach: https://github.com/dtolnay/trybuild/issues/35#issuecomment-539253118 ## Solution Summary `cargo expand` should be able to expand the code of a test file `somename.rs` in the `tests` directory of a given...

For example, avoid expanding `try!` and other macros inside the output of proc macros. cc @djc

enhancement

Currently the Cargo subprocess spawned by cargo-expand does not display Cargo's usual progress bar. I believe this is because we pipe the child's stderr to perform filtering here: https://github.com/dtolnay/cargo-expand/blob/3ae4ca126a4bd557ef7f7954911d65db56525b37/src/main.rs#L358 and...

help wanted

I would expect something like `cargo expand --build`, which shows build.rs after macro expansion.

help wanted

Currently macro_rules definitions are not visible in the expanded code. Sometimes it can be useful to see them, such as when you have a procedural macro whose job is to...

Rustfmt can hit cases where code takes exponentially long to format, particularly in macro-generated code. https://github.com/rust-lang/rustfmt/issues/3465 We may want to consider limiting rustfmt execution time to some small number of...

If the user has a crate like: ```rust fn main() { println!("{:?}", S); } ``` We can inject the following code before compiling, I guess similarly to how `cargo clippy`...

enhancement