I just found How do I see the expanded macro code that's causing my compile error?. Is it possible to get the expansion of a single macro instead of the whole file?
相关问题
- Share Arc between closures
- Function references: expected bound lifetime param
- Pattern matching on slices
- How can I iteratively call Sha256::digest, passing
- Destructure a vector into variables and give away
相关文章
- How can I convert a f64 to f32 and get the closest
- What is a good way of cleaning up after a unit tes
- How can I unpack (destructure) elements from a vec
- How to import macros in Rust?
- How to get struct field names in Rust? [duplicate]
- Confusion between [T] and &[T]
- How do I initialize an opaque C struct when using
- What's the most idiomatic way to test two Opti
The
cargo-expand
command is really just a thin wrapper aroundcargo rustc -- -Zunstable-options --pretty=expanded
, which is itself a blunt instrument. You can't target a specific macro.However, since version 0.4, you can reduce some noise by specifying an extra path argument to expand only macros used by that module:
"Show expanded macro" and "Show recursively expanded macro" commands were recently added to IntelliJ Rust.
A gif demo from CLion blog post: