-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Allow pat
macro matcher be followed by |
#1336
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
Comments
pat
macro matched be followed by |
pat
macro matcher be followed by |
Workaround (stolen from https://github.com/SimonSapin/rust-std-candidates/blob/master/matches/lib.rs):
|
Also, |
Along these lines, it seems to me that:
Is this right or do I have misconceptions about what FOLLOW really means? @petrochenkov that workaround sort of works but (a) only if |
Great. Looking forward to that RFC :) |
This was originally disallowed because we were thinking we might expand (I guess this is more compelling with |
Ah I see. Though, that specific case could be done by changing the grammar of |
Yes, the |
Right, makes sense. Seems like closures do kill it, unless the multi-pat syntax isn't allowed in closure/function arguments... but then that seems to cry out for another fragment specifier along the lines of |
Or if patterns were allowed to be enclosed in parentheses, that could save it. |
That would be useful, I remember I needed this and certainly more than once. If it could be done by minor not-very-breaking-in-practice restrictions in other parts of grammar, it would totally worth it. |
Ah, that could make everyone happy... e.g. I would still be able to put |
It still could create a breaking change -- if |
@durka ah sorry I was not clear What I meant was: if |
Ah gotcha. On Fri, Dec 4, 2015 at 12:49 PM, Felix S Klock II [email protected]
|
(this has been folded into RFC amendment #1384, which has been accepted.) |
Since code like
is possible, there’s no problem if
pat
is followed by a|
. It should be allowed in macro so e.g.is possible.
The text was updated successfully, but these errors were encountered: