Hacker News new | ask | show | jobs
by mmastrac 5 days ago
Types and generics are hard to parse in regular macros without a tt muncher. Ditto for fn args. If you need to do actual matching of types, you can't capture them as $xxx:ty because Rust will not allow a larger matched token to be broken up again (unless you use a paste! hack to roundtrip it back into ungrouped tokens).

I wrote https://crates.io/crates/type-mapper as a way to work around those limitations but it is _very_ painful TBH.