-
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
Revert "Teach parser to understand fake anonymous enum syntax" and related commits #107478
Revert "Teach parser to understand fake anonymous enum syntax" and related commits #107478
Conversation
r? @oli-obk (rustbot has picked a reviewer for you, use r? to override) |
@compiler-errors can you add tests for those ambiguous case, in case someone tries to do this again? r=me |
I did in 859b14ce7d469bc1af3ee396fd8e91b7b2e20d6f 😸 @bors r=estebank |
📌 Commit 859b14ce7d469bc1af3ee396fd8e91b7b2e20d6f has been approved by It is now in the queue for this repository. |
I think that instead we can rely on global Parser state to control when these kinds of anon enums can be detected. I have global state, but it is a natural communication mechanism for the parser :-/ |
I just noticed that the type ascription in patterns change is also being reverted here. Would you mind relanding those on their own? |
@estebank oh yes, let me re-teach the compiler those really quick. Sorry, I totally overlooked those because they weren't their own commit 😅 |
859b14c
to
daf3828
Compare
Added a few more test cases that shouldn't be broken when this PR is re-attempted. @bors r=estebank |
📌 Commit daf382895f3fcd635c95bf2a95114f5ed6dc9e61 has been approved by It is now in the queue for this repository. |
☔ The latest upstream changes (presumably #107536) made this pull request unmergeable. Please resolve the merge conflicts. |
🔒 Merge conflict This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again. How do I rebase?Assuming
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial. Please avoid the "Resolve conflicts" button on GitHub. It uses Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Error message
|
daf3828
to
250f530
Compare
@bors r=estebank |
🌲 The tree is currently closed for pull requests below priority 50. This pull request will be tested once the tree is reopened. |
…ambiguous, r=estebank Revert "Teach parser to understand fake anonymous enum syntax" and related commits anonymous enum types are currently ambiguous in positions like: * `|` operator: `a as fn() -> B | C` * closure args: `|_: as fn() -> A | B` I first tried to thread around `RecoverAnonEnum` into all these positions, but the resulting complexity in the compiler is IMO not worth it, or at least worth a bit more thinking time. In the mean time, let's revert this syntax for now, so we can go back to the drawing board. Fixes rust-lang#107461 cc: `@estebank` `@cjgillot` rust-lang#106960 --- ### Squashed revert commits: Revert "review comment: Remove AST AnonTy" This reverts commit 020cca8. Revert "Ensure macros are not affected" This reverts commit 12d18e4. Revert "Emit fewer errors on patterns with possible type ascription" This reverts commit c847a01. Revert "Teach parser to understand fake anonymous enum syntax" This reverts commit 2d82420.
☔ The latest upstream changes (presumably #105670) made this pull request unmergeable. Please resolve the merge conflicts. |
…lated commits Revert "review comment: Remove AST AnonTy" This reverts commit 020cca8. Revert "Ensure macros are not affected" This reverts commit 12d18e4. Revert "Emit fewer errors on patterns with possible type ascription" This reverts commit c847a01. Revert "Teach parser to understand fake anonymous enum syntax" This reverts commit 2d82420.
250f530
to
39db65c
Compare
This is bitrotty, but also P-critical 😓 @bors p=1 |
@bors r=estebank |
☀️ Test successful - checks-actions |
1 similar comment
☀️ Test successful - checks-actions |
Finished benchmarking commit (97872b7): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. |
…ler-errors Parse and recover from type ascription in patterns Reintroduce part of rust-lang#106960, which was reverted in rust-lang#107478. r? `@compiler-errors`
anonymous enum types are currently ambiguous in positions like:
|
operator:a as fn() -> B | C
|_: as fn() -> A | B
I first tried to thread around
RecoverAnonEnum
into all these positions, but the resulting complexity in the compiler is IMO not worth it, or at least worth a bit more thinking time. In the mean time, let's revert this syntax for now, so we can go back to the drawing board.Fixes #107461
cc: @estebank @cjgillot #106960
Squashed revert commits:
Revert "review comment: Remove AST AnonTy"
This reverts commit 020cca8.
Revert "Ensure macros are not affected"
This reverts commit 12d18e4.
Revert "Emit fewer errors on patterns with possible type ascription"
This reverts commit c847a01.
Revert "Teach parser to understand fake anonymous enum syntax"
This reverts commit 2d82420.