Remove never_type feature requirement for exhaustive patterns
This commit is contained in:
parent
f119bf2761
commit
ff67b9072b
2 changed files with 9 additions and 1 deletions
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
// check-pass
|
||||
|
||||
#![feature(exhaustive_patterns)]
|
||||
|
||||
enum Void {}
|
||||
fn main() {
|
||||
let a: Option<Void> = None;
|
||||
let None = a;
|
||||
}
|
Loading…
Add table
Reference in a new issue