2012-01-19 20:31:08 -06:00
|
|
|
enum t { a, b, }
|
2010-12-02 16:50:00 -06:00
|
|
|
|
2012-02-15 02:40:42 -06:00
|
|
|
fn main() {
|
|
|
|
let x = a;
|
|
|
|
alt x { b { } } //! ERROR non-exhaustive patterns
|
2012-04-24 04:13:25 -05:00
|
|
|
alt true { //! ERROR non-exhaustive patterns
|
2012-02-15 02:40:42 -06:00
|
|
|
true {}
|
|
|
|
}
|
|
|
|
alt @some(10) { //! ERROR non-exhaustive patterns
|
|
|
|
@none {}
|
|
|
|
}
|
2012-04-24 04:13:25 -05:00
|
|
|
alt (2, 3, 4) { //! ERROR non-exhaustive patterns
|
2012-02-15 02:40:42 -06:00
|
|
|
(_, _, 4) {}
|
|
|
|
}
|
2012-04-24 04:13:25 -05:00
|
|
|
alt (a, a) { //! ERROR non-exhaustive patterns
|
|
|
|
(a, b) {}
|
|
|
|
(b, a) {}
|
|
|
|
}
|
|
|
|
// This is exhaustive, though the algorithm got it wrong at one point
|
|
|
|
alt (a, b) {
|
|
|
|
(a, _) {}
|
|
|
|
(_, a) {}
|
|
|
|
(b, b) {}
|
|
|
|
}
|
2012-02-15 02:40:42 -06:00
|
|
|
}
|