Skip to content

Commit ff67b90

Browse files
committed
Remove never_type feature requirement for exhaustive patterns
1 parent f119bf2 commit ff67b90

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/librustc_mir/build/matches/simplify.rs

-1
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
}
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)