rust/src/test/compile-fail/non-exhaustive-match-nested.rs
Tim Chevalier fba35e1a3c Require alts to be exhaustive
middle::check_alt does the work. Lots of changes to add default cases
into alts that were previously inexhaustive.
2012-01-31 10:08:24 -08:00

14 lines
197 B
Rust

// -*- rust -*-
// error-pattern: Non-exhaustive pattern
enum t { a(u), b }
enum u { c, d }
fn main() {
let x = a(c);
alt x {
a(d) { fail "hello"; }
b { fail "goodbye"; }
}
}