Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jruderman opened this issue Jul 26, 2012 · 1 comment
Closed
Labels
A-type-system Area: Type system E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@jruderman
Copy link
Contributor

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

@catamorphism
Copy link
Contributor

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

@ghost ghost assigned catamorphism Jul 26, 2012
RalfJung pushed a commit to RalfJung/rust that referenced this issue Aug 31, 2023
fix some bad regex capture group references in test normalization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

2 participants