Skip to content

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

Closed

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 :)

Activity

  1. catamorphism commented on Jul 26, 2012

    @catamorphism
    Contributor

    Nice bug :-) I'll try to fix it.

  2. added a commit that references this issue on Aug 31, 2023
  3. added a commit that references this issue on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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