External Publication
Visit Post

[Pre-RFC] Allow attributes to be applied to generic arguments

Rust Internals [Unofficial] March 26, 2026
Source

Yes please. Generics are the last set of "comma-terminated fragments" remaining that I would also like to see supported with cfg-attributes[1]. I have a full list of them on this HackMD page. Generally speaking, I believe if any token fragment terminates with a(n optional) comma in Rust, it should be possible to conditionally omit it with a cfg-attribute.

You might be interested in RFC 3399 (accepted) and RFC 3532 (in FCP, hopefully about to be accepted) for prior art on my personal RFC effort to support cfg-attributes in more places.


  1. Aside from braced multi-use statements, but that's not terribly important IMO ↩︎

Discussion in the ATmosphere

Loading comments...