//@ aux-build: staged-api.rs //@ revisions: current exhaustive #![feature(exhaustive_patterns)] extern crate staged_api; use staged_api::Foo; enum Void {} fn demo(x: Foo) { match x {} //~^ ERROR non-exhaustive patterns } // Ensure that the pattern is not considered unreachable. fn demo2(x: Foo) { match x { Foo { .. } => {} } } // Same as above, but for wildcard. fn demo3(x: Foo) { match x { _ => {} } } fn main() {}