Closed
Description
Currently this does not compile:
enum Void {}
fn main() {
let x = None::<Void>;
match x {
None => println!("hi"),
}
}
<anon>:5:5: 7:6 error: non-exhaustive patterns: `Some(_)` not covered [E0004]
<anon>:5 match x {
<anon>:6 None => println!("hi"),
<anon>:7 }
I contend that because Some::<Void>
is impossible to construct (Void
is an uninhabited enum), exhaustiveness should not require it to be matched against.
Metadata
Metadata
Assignees
Labels
No labels