Closed TennyZhuang closed 5 months ago
When I try to do that, I know why we have to use ident
here now :(
https://internals.rust-lang.org/t/allow-and-to-follow-path-fragment-in-macro/7796/2
If we don't want to rewrite the macro using proc-macro, we can't really support the feature.
Finally, I found it's doable by $($name: ident)::*
Please complete the following tasks
winnow version
0.6.9
Describe your use case
If we have an enum like this:
And we want to construct it during parsing, currently we must explicit
use Expr::Cast
.There is no reason to disallow we use
Expr::Cast
here directly:Describe the solution you'd like
Change
$name: ident
to$name: path
here.Alternatives, if applicable
No response
Additional Context
No response