-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-coroutinesArea: CoroutinesArea: CoroutinesA-type-systemArea: Type systemArea: Type systemAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Description
Today, valid programs using coroutines (and async/await) are rejected by the compiler because it thinks certain values may be held across yields when they are not.
Examples / to do: (please add more as they come up)
- async/await: awaiting inside a match block captures borrow too eagerly #57017
- Dropped variables still included in generator type #57478
- Indexing via
index
method and[idx]
sugar works differently inasync
blocks/functions #72956 - ICE: Broken MIR #72651
- The rules for how non-Send local variables "infect" an async function, making its Future type non-Send also, are stricter than they need to be. #63768
- Moved value is considered as held across an
await
inasync fn
#87309 - Future non-Send although non-Send local is dropped before .await #104883
Unresolved Questions
How should we implement this?
Are there any programs which could be accepted, but shouldn't be because they would depend too heavily on implementation details of the compiler?
Implementation notes
There's some discussion here: #57017 (comment)
This issue has been assigned to @eholk via this comment.
vultix, CypherNaught-0x, GoldsteinE, memoryruins, biro456 and 20 moreDanielLiu-326, thebluetropics and sergioabreu-g
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-coroutinesArea: CoroutinesArea: CoroutinesA-type-systemArea: Type systemArea: Type systemAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Type
Projects
Status
On deck