1 // aux-build:uninhabited.rs
2 #![deny(unreachable_patterns)]
3 #![feature(never_type)]
4 #![feature(non_exhaustive)]
6 extern crate uninhabited;
8 use uninhabited::PartiallyInhabitedVariants;
10 // This test checks a redundant/useless pattern of a non-exhaustive enum/variant is still
13 pub fn foo(x: PartiallyInhabitedVariants) {
15 PartiallyInhabitedVariants::Struct { .. } => {},
16 PartiallyInhabitedVariants::Struct { .. } => {},
17 //~^ ERROR unreachable pattern