Fix ICE on invalid variable declarations in macro calls#105141
Merged
bors merged 2 commits intorust-lang:masterfrom Dec 4, 2022
Merged
Fix ICE on invalid variable declarations in macro calls#105141bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
Collaborator
|
r? @TaKO8Ki (rustbot has picked a reviewer for you, use r? to override) |
ohno418
commented
Dec 1, 2022
ohno418
commented
Dec 1, 2022
Contributor
Contributor
There was a problem hiding this comment.
Can you use a may_recover check in all of these failure branches?
Contributor
There was a problem hiding this comment.
Sorry, I mean the var and mut, etc. branches
Contributor
There was a problem hiding this comment.
Is this needed for something? Otherwise, can you remove it?
Contributor
Author
There was a problem hiding this comment.
Ah, I was using this for debugging, so thought this might be useful. Anyway, I'll remove it. Thanks!
Contributor
|
Please use |
Fix ICE on parsing an invalid variable declaration as a statement like:
```
macro_rules! m { ($s:stmt) => {} }
m! { var x }
```
Previously, the `recover_local_after_let` function was called from the body of the `recover_stmt_local` function. Unifying these two functions make it more simple and more readable.
3a78430 to
e481258
Compare
Contributor
Author
|
@compiler-errors Thank you for the review! Fixed. |
Contributor
|
@bors r+ rollup |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 4, 2022
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#101975 (Suggest to use . instead of :: when accessing a method of an object) - rust-lang#105141 (Fix ICE on invalid variable declarations in macro calls) - rust-lang#105224 (Properly substitute inherent associated types.) - rust-lang#105236 (Add regression test for rust-lang#47814) - rust-lang#105247 (Use parent function WfCheckingContext to check RPITIT.) - rust-lang#105253 (Update a couple of rustbuild deps) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes ICE that happens with invalid variable declarations in macro calls like:
Found this is because of not collecting tokens on recovery, so I changed to force collect them.
Fixes #103529.