-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
[WIP] Check future proofing of macros with multiple arms using FIRST sets. #34140
Conversation
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
65973b3
to
088f7fa
Compare
I like the warnings, but I think we should use this info to be careful about syntax changes, rather than punishing macro authors for not predicting the future (so I would be against hard errors). |
I imagine we would try to take the effect of such changes into account On Wed, Jun 08, 2016 at 11:41:37AM -0700, Alex Burka wrote:
|
Ok so here are the first results (including the Rust codebase and the unit tests, not crater yet): Broken macros in the Rust codebase:
Failed tests:
For now I identified three patterns:
cc @pnkfelix |
aa43a89
to
ec02edf
Compare
☔ The latest upstream changes (presumably #34239) made this pull request unmergeable. Please resolve the merge conflicts. |
eaa8234
to
b519253
Compare
…tcher only contain simple tokens. Those were rejected before when the NT or seq can match several token trees because we did not know where to continue the analysis. But if the rest of the first matcher does not contain any NT matcher, we do not need to continue the analysis.
4a0b8b4
to
19b8ebd
Compare
A `tt` matcher in the second arm versus a `block` matcher in the first arm is not future-proof. Also clean-up a bit the code for the single-TT special cases.
19b8ebd
to
02f1e17
Compare
807705a
to
ad2eacb
Compare
This means a matcher will be accepted if it only contains tokens, `ident` or `tt` NT matchers, or delimited/sequences of them. This is valid beacuse `tt` will never start matching more input that matches the second matcher.
ad2eacb
to
3a1828f
Compare
☔ The latest upstream changes (presumably #34811) made this pull request unmergeable. Please resolve the merge conflicts. |
Ditto. Let's close if this isn't going to progress. |
Agreed. @LeoTestard if you end up updating this, please let us know, but with months with no activity, I'm going to give this a close. |
Far from being finished. The
first_sets_disjoints
is still the biggest missing piece.cc @pnkfelix @nikomatsakis