Allow attributes in logical parameter position #55033
Labels
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
needs-rfc
This change is large or controversial enough that it should have an RFC accepted before doing it.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
Uh oh!
There was an error while loading. Please reload this page.
Allow attributes in logical parameter position like here
Current Situation
The compiler currently simply does not allow for attributes in this position:
Rational
This could be very useful for some procedural macros which was effectively my use case yesterday.
Also I can imagine use cases for something like an
#[ignore]
attribute to say that a parameter is not in use which is currently implied by prefixing its name with an underscore. However, at least to me such an#[ignore]
attribute (or come up with a better name for it) would be much more explicit which sticks better to the explicit nature of the language itself.Other Sources
On march this year (2018) @petrochenkov was already talking about the usefulness of attributes for formal function parameters in this thread.
If there is anybody who is free of time and wants to give it a try I would be very grateful. Otherwise I would try implementing it in my spare time.
The text was updated successfully, but these errors were encountered: