Closed
Description
Consider this macro:
macro_rules! m { (<$t:ty>) => { stringify!($t) } }
Unfortunately it can't deal with a type that ends in >
:
m!(<Vec<i32>>)
error: no rules expected the token `>>`
--> .cargo/.cargo/script-cache/expr-edcce559d98013ba/expr.rs:5:64
|
5 | {macro_rules! m { (<$t:ty>) => { stringify!($t) } } m!(<Vec<i32>>)}
| ^^
error: Could not compile `expr`.
Is it possible to fix this? It seems to me the macro parser should know it's parsing $t:ty
and therefore >>
can't be valid, so it should be split into two tokens.
cc @jseyfried
Metadata
Metadata
Assignees
Labels
No labels