Skip to content

Attempting to run an async fn after completion mentions generators #65419

Closed
@Nemo157

Description

@Nemo157

If a user attempts to do something like this (playground including trivial executor):

async fn foo() {
}

fn main() {
    let mut future = Box::pin(foo());
    executor::block_on(future.as_mut());
    executor::block_on(future.as_mut());
}

they get a panic talking about generators:

thread 'main' panicked at 'generator resumed after completion', src/main.rs:1:16

This issue has been assigned to @ninjasource via this comment.

Metadata

Metadata

Assignees

Labels

A-async-awaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions