Skip to content

Commit

Permalink
Remove never_type feature requirement for exhaustive patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
hellow554 committed Jul 5, 2019
1 parent f119bf2 commit ff67b90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/librustc_mir/build/matches/simplify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
PatternKind::Variant { adt_def, substs, variant_index, ref subpatterns } => {
let irrefutable = adt_def.variants.iter_enumerated().all(|(i, v)| {
i == variant_index || {
self.hir.tcx().features().never_type &&
self.hir.tcx().features().exhaustive_patterns &&
!v.uninhabited_from(self.hir.tcx(), substs, adt_def.adt_kind()).is_empty()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// check-pass

#![feature(exhaustive_patterns)]

enum Void {}
fn main() {
let a: Option<Void> = None;
let None = a;
}

0 comments on commit ff67b90

Please sign in to comment.