Skip to content
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

Actually parse async gen blocks correctly #118891

Merged
merged 1 commit into from Dec 13, 2023

Conversation

compiler-errors
Copy link
Member

  1. I got the control flow in parse_expr_bottom messed up, and obviously forgot a test for async gen, so we weren't actually ever parsing it correctly.
  2. I forgot to gate the span for async gen {}, so even if we did parse it, we wouldn't have correctly denied it in cfg(FALSE).

r? eholk

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 12, 2023
@eholk
Copy link
Contributor

eholk commented Dec 12, 2023

So does this mean async gen {} blocks were just entirely broken? Or was there some version that worked?

@compiler-errors
Copy link
Member Author

async gen fn worked, but async gen {} did not work at all. I only had a test for the former, and only had tested the latter manually and only before I refactored the parsing code...

@eholk
Copy link
Contributor

eholk commented Dec 12, 2023

Ah, that makes sense :)

I was wondering if it had something to do with the late addition of async gen fn, and it sounds like it did.

Anyway, the PR looks good!

@bors r+

@bors
Copy link
Contributor

bors commented Dec 12, 2023

📌 Commit 1d78ce6 has been approved by eholk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 12, 2023
@eholk
Copy link
Contributor

eholk commented Dec 12, 2023

@bors rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 13, 2023
…kingjubilee

Rollup of 10 pull requests

Successful merges:

 - rust-lang#118858 (Remove dead codes in core)
 - rust-lang#118864 (Fix alignment passed down to LLVM for simd_masked_load)
 - rust-lang#118872 (Add rustX check to codeblock attributes lint)
 - rust-lang#118873 (fix `waker_getters` tracking issue number)
 - rust-lang#118884 (NFC: simplify merging of two vecs)
 - rust-lang#118885 (clippy::complexity fixes)
 - rust-lang#118886 (Clean up variables in `search.js`)
 - rust-lang#118887 (Typo)
 - rust-lang#118889 (more clippy::complexity fixes)
 - rust-lang#118891 (Actually parse async gen blocks correctly)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f9078a4 into rust-lang:master Dec 13, 2023
11 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Dec 13, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 13, 2023
Rollup merge of rust-lang#118891 - compiler-errors:async-gen-blocks, r=eholk

Actually parse async gen blocks correctly

1. I got the control flow in `parse_expr_bottom` messed up, and obviously forgot a test for `async gen`, so we weren't actually ever parsing it correctly.
2. I forgot to gate the span for `async gen {}`, so even if we did parse it, we wouldn't have correctly denied it in `cfg(FALSE)`.

r? eholk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants