Skip to content

Commit 99e7328

Browse files
Rollup merge of rust-lang#62405 - hellow554:patch-1, r=varkor
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
2 parents f940617 + ff67b90 commit 99e7328

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/librustc_mir/build/matches/simplify.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
161161
PatternKind::Variant { adt_def, substs, variant_index, ref subpatterns } => {
162162
let irrefutable = adt_def.variants.iter_enumerated().all(|(i, v)| {
163163
i == variant_index || {
164-
self.hir.tcx().features().never_type &&
165164
self.hir.tcx().features().exhaustive_patterns &&
166165
!v.uninhabited_from(self.hir.tcx(), substs, adt_def.adt_kind()).is_empty()
167166
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// check-pass
2+
3+
#![feature(exhaustive_patterns)]
4+
5+
enum Void {}
6+
fn main() {
7+
let a: Option<Void> = None;
8+
let None = a;
9+
}

0 commit comments

Comments
 (0)