Re: [PATCH] rust: add procedural macro for declaring configfs attributes

From: Andreas Hindborg

Date: Fri May 22 2026 - 02:23:10 EST


"Gary Guo" <gary@xxxxxxxxxxx> writes:

> On Wed May 20, 2026 at 9:40 AM CEST, Malte Wechter wrote:
>> Implement `configfs_attrs!` as a procedural macro using `syn`, this
>> improves readability and maintainability. Remove the old macro and
>> replace all uses with the new macro. Add the new macro implementation
>> file to MAINTAINERS.
>
> The current declarative macro implementation is quite readable and IMO more so
> than this syn rewrite.
>
> Unless there's a compelling use case where it needs to be implememented using
> token munchers with declarative macro but can be easily parsed with proc macro,
> I think it should just stay as decl macro.

I disagree. I think the proc macro is difficult to read and maintain,
and I prefer a procedural parser.

Best regards,
Andreas Hindborg