Skip to content

Tracking uninhabited types in matches #51076

@Victor-Savu

Description

@Victor-Savu

I think there has been a regression for the treatment of uninhabited types at some point:

#![feature(never_type)]

fn foo() ->  Result<(), !> {
    return Ok(());
}

fn main() {
    match foo() {
        Ok(_) => println!("yay!")
    }
}

now fails with:

error[E0004]: non-exhaustive patterns: `Err(_)` not covered
 --> src/main.rs:7:11
  |
7 |     match foo() {
  |           ^^^^^ pattern `Err(_)` not covered

I will bisect and report back when I find the commit which caused the regression.

Last known to work on:

  • nightly-2018-03-15

Was already failing on:

  • nightly-2018-04-01

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions