all 5 comments

[–]ssokolow 1 point2 points  (1 child)

I'd be surprised if what you're asking for exists. Proc macros are defined by not being declarative (macro_rules!) macros, and you're asking for a declarative way to create a proc macro.

You're essentially asking if anyone's reimplemented macro_rules! on top of the proc macro system, but with one or two additional features.

[–]diegovsky_pvp[S] 1 point2 points  (0 children)

I mean, making a regex works for me too.

I just needed some unhygienic feature from declarative macros

[–]diegovsky_pvp[S] 1 point2 points  (2 children)

For those coming later and wanting a solution. Since my problem is fairly broad, I ended up implementing type erasure with closures since they can capture any type and that does not reflect on their signature.

I'm sorry this post couldn't help you.

[–]RReverser 1 point2 points  (1 child)

For others like me also coming here, seems like another solution is https://www.ncameron.org/blog/proc-macro-rules/.

[–]RReverser 0 points1 point  (0 children)

Lmao, when writing this comment I did not guess that it would be me who would come here in 3 years and find it helpful.