-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tracking issue for adding a lifetime
specifier to macro_rules!
#34303
Comments
I'll open a new PR soon, I want to do one more thing on top of #33135 |
Godspeed, @sgrif! This being in nightly would make my week. |
@sgrif Any update? |
This doesn't seem particularly hard. Help wanted. |
I wish we knew what the "one more thing" was besides just reopening the closed PR. |
I'd like to help implement this. Where do I start? |
@mikeyhew
This should be something truly marvelous, that this GitHub comment was too narrow to contain. |
This issue should remain open until the feature is stable, right? |
Some alternatives are discussed in https://internals.rust-lang.org/t/pre-rfc-splitting-lifetime-into-two-tokens/6716 - either splitting lifetimes into two tokens, then they can be matched with I don't think it prevents stabilization of the |
@rfcbot fcp merge trying again |
@rfcbot fcp merge See @cramertj's brief summary here. |
Team member @nikomatsakis has proposed to merge this. The next step is review by the rest of the tagged teams: Concerns:
Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
@rfcbot fcp concern @petrochenkov recently brought it to my attention that On the other hand, I can see an argument that not supporting |
@rfcbot concern underscore-lifetime |
(Bother, I can never remember the dang syntax.) |
If I understand correctly, '_ is going to become very common very soon
because elision on structs will be partially removed, meaning `struct
Foo<'a>(&'a str); fn bar(&str) -> Foo {...}` turns into `fn bar(&str) ->
Foo<'_>`. (Biting my tongue about my thoughts on that change because it's
irrelevant to this issue.) In that case I think users will be very confused
if `m!(Foo<'a>)` works but `m!(Foo<'_>)` doesn't. We are adding this
feature to make macros more flexible. You could still match '_ and 'a using
two rules (one with literal '_ and one with $lt:lifetime) but why throw up
that arbitrary barrier?
_ as ident is a separate thing but at least it does match as a pat.
…On Thu, Mar 15, 2018 at 12:32 PM, Niko Matsakis ***@***.***> wrote:
(Bother, I can never remember the dang syntax.)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#34303 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAC3n2QjhQ2VQW3En09_RyWhNU_DluNzks5tepexgaJpZM4I3Wep>
.
|
@nikomatsakis please say "resolved" for the bot |
@rfcbot resolved underscore-lifetime Sigh. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period is now complete. |
🚀 🚀 🚀 🚀 🚀 |
stabilize macro_lifetime_matcher This stabilizes `:lifetime` which has completed FCP in #34303.
We don't have tests for a macro_rules falling through to the next rule after a $:lifetime matcher. And it doesn't work. 😢 I filed #51477 to follow up. |
I think we can close this as it was stabilized; bugs and other things can be tracked as we usually do. |
cc rust-lang/rfcs#1590 @sgrif
The text was updated successfully, but these errors were encountered: