Skip to content

never patterns: ! argument not detected as diverging on async fn #120240

Open

Description

With #120104, a function with a ! pattern in a binding is detected as diverging:

fn never_arg(!: Void) -> ! {}
fn never_let(x: Void) -> ! {
  let ! = x;
}

This doesn't work the arguments of an async fn however:

async fn never_let(x: Void) -> ! {
  let ! = x;
} // ok
async fn never_arg(!: Void) -> ! {} // ERROR mistmatched types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-async-awaitArea: Async & AwaitAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.F-never_patterns`#![feature(never_patterns)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-asyncWorking group: Async & awaitrequires-incomplete-features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions