Skip to content

Incorrect "non-exhaustive patterns" message with zero-variant enum #3037

Closed
@jruderman

Description

@jruderman
enum what { }

fn what_to_str(x: what) -> ~str
{
    alt x {
    }
}

fn main()
{
}

gives me

/Users/jruderman/Desktop/unlikely_non-exhaustive.rs:5:4: 6:5 error: non-exhaustive patterns
/Users/jruderman/Desktop/unlikely_non-exhaustive.rs:5     alt x {
/Users/jruderman/Desktop/unlikely_non-exhaustive.rs:6     }

I did exhaust all the cases of the what enum, however vacuously :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions