-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Inconsistent macro repeat operator leads to panic on nightly #61033
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Yay, we have a test case. |
Hmm... interesting... yeah, I guess we have a test case. I will open a PR to revert #60620 and add the test case. Thanks @birkenfeld ! But this raises a bigger point that has been growing on me for a while now: there are a ton of checks that are currently only done at macro invocation time (or are not done at all) that really would make more sense to do a macro definition time.
So far, I have been holding off on attempting to fix these because they could involve building a whole language, and it seems that at some point we want to just use |
Opened #61046 |
If the defined macro produces an error with any possible input, then we should probably report it at definition time, at least as a quality of implementation measure (perhaps as a warning for a start). I have more confidence in reporting errors related to the macro definition language itself (meta-variables, repetitions, etc.), than in errors for produced tokens (which are not necessarily supposed to be Rust code, with eager expansion they may be consumed by another macro, for example). |
@petrochenkov Ok, makes sense. I will open another issue with these items so we can track them. |
…nkov Fix ICE with inconsistent macro matchers Fixes rust-lang#61033 r? @petrochenkov
Given this test file:
stable Rust errors like this:
while on 1.36.0-nightly (50a0def 2019-05-21) running on x86_64-unknown-linux-gnu:
The text was updated successfully, but these errors were encountered: