1
Fork 0

Rollup merge of #62405 - hellow554:patch-1, r=varkor

Remove never_type feature requirement for exhaustive patterns

I **think** this resolves #51221
At least for me, it doesn't ICE anymore and all tests are still passing, so LGTM
This commit is contained in:
Mark Rousskov 2019-07-15 19:55:00 -04:00 committed by GitHub
commit 99e7328d13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -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()
}

View file

@ -0,0 +1,9 @@
// check-pass
#![feature(exhaustive_patterns)]
enum Void {}
fn main() {
let a: Option<Void> = None;
let None = a;
}