Skip to content

Async function return type inference fails without an ending return #64392

@khionu

Description

@khionu

I have a function of the signature async fn run() -> Result<!, Box<dyn std::error::Error>>. It ends with a loop that, as you may infer, never returns Ok. The inference for code generation failed, and the various compiler errors said that my function actually returned ().

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-async-awaitArea: Async & AwaitA-inferenceArea: Type inferenceC-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