Skip to content

Commit

Permalink
Rollup merge of rust-lang#62405 - hellow554:patch-1, r=varkor
Browse files Browse the repository at this point in the history
Remove never_type feature requirement for exhaustive patterns

I **think** this resolves rust-lang#51221
At least for me, it doesn't ICE anymore and all tests are still passing, so LGTM
  • Loading branch information
Mark-Simulacrum authored Jul 15, 2019
2 parents f940617 + ff67b90 commit 99e7328
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 99e7328

Please sign in to comment.