4 ms·
Is there a way in rust to see the "desugared" rust code, e.g. with all macros, traits, generics etc expanded? I feel this would be helpful to cut through the ab
by xg15 1y ago
Is there a way in rust to see the "desugared" rust code, e.g. with all macros, traits, generics etc expanded? I feel this would be helpful to cut through the abstractions.
- brooke2k 1y agoIIRC rust-analyzer lets you view the expanded form of macros (declarative ones at least, maybe procedural too?)
- maxbond 1y agoFor macros, yes, `cargo expand`. For generics, no, but you can query this information in your IDE pretty easily. You can also also use `cargo doc` to build the generated documentation, which will show you the list of traits something implements.
- pjmlp 1y agoKind of, some of the stuff you can see on Rust Playground.