Skip to content

Conversation

@ChayimFriedman2
Copy link
Contributor

As TyKind::Coroutine/TyKind::CoroutineClosure, versus an opaque/normal closure.

Can be reviewed commit-by-commit. The commit messages are also important.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 23, 2025
Instead of `TyKind::Closure`.

Note: the same `InternedCoroutineId` is used both for the *async closure* as well as for the *async block it returns*. When used in `TyKind::CoroutineClosure`, it represents the closure. When used in `TyKind::Coroutine`, it represents the async block. The generic args are different, though.

Also noteworthy is that we distinguish between the different kinds of coroutines (general coroutines, async coroutines and eventually gen coroutines too) via the expression producing them (stored in the `InternedCoroutineId`). It might be worth it to introduce a `CoroutineKind` field to `InternedCoroutineId`, although this is not done in this PR.
@ShoyuVanilla ShoyuVanilla added this pull request to the merge queue Oct 24, 2025
Merged via the queue into rust-lang:master with commit 6b89e4b Oct 24, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 24, 2025
@lnicola
Copy link
Member

lnicola commented Oct 24, 2025

changelog fixup #20329

@ChayimFriedman2 ChayimFriedman2 deleted the async-block-no-opaque branch October 24, 2025 14:05
mendelsshop pushed a commit to mendelsshop/rust-analyzer that referenced this pull request Oct 27, 2025
…o-opaque

fix: Lower async block/closures correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants