-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add macro lifetime specifier #25509
Add macro lifetime specifier #25509
Conversation
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
One point of possible worry is that |
Allows accepting a lifetime as a parameter to a macro Fix line wrapping. Rename "lifetime" to "life" to avoid conflict with future keyword.
I renamed it to use "life" instead of "lifetime" to avoid the conflict. |
Bump? @huonw |
Hm, I think this needs a few more pairs of eyes. |
Seems like an RFC would make sense to work out naming etc. But also, this should be feature-gated. |
During lang subteam mtg, we decided this should have an RFC, since it is a language extension, albeit a minor one. Removing nomination since we've taken a look (no priority needed). |
☔ The latest upstream changes (presumably #27849) made this pull request unmergeable. Please resolve the merge conflicts. |
@Diggsey any interest in pursuing an RFC for this, like @nikomatsakis suggested? |
I'd be interested in helping with an RFC for this. |
It occurs to me that adding a fragment specifier for lifetimes doesn't actually fix significant situations where you might want to parse a lifetime specifier, for example in a list of generic parameters. In such a situation you would have to differentiate a lifetime specifier from an identifier, and in general a macro can't alternate on one fragment specifier vs another, unless this is actually a bug (cf #27832). A design which could allow such alternation is not a new fragment specifier, but a (hopefully minor) modification to the lexer to allow |
Closing due to inactivity (and sounds like an RFC is desired) |
Allows accepting a lifetime as a parameter to a macro.
Fixes #23956