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;
|
2012-08-06 14:34:08 -05:00
|
|
|
match x { b => { } } //~ ERROR non-exhaustive patterns
|
|
|
|
match true { //~ ERROR non-exhaustive patterns
|
2012-08-03 21:59:04 -05:00
|
|
|
true => {}
|
2012-02-15 02:40:42 -06:00
|
|
|
}
|
2012-08-20 14:23:37 -05:00
|
|
|
match @Some(10) { //~ ERROR non-exhaustive patterns
|
|
|
|
@None => {}
|
2012-02-15 02:40:42 -06:00
|
|
|
}
|
2012-08-06 14:34:08 -05:00
|
|
|
match (2, 3, 4) { //~ ERROR non-exhaustive patterns
|
2012-08-03 21:59:04 -05:00
|
|
|
(_, _, 4) => {}
|
2012-02-15 02:40:42 -06:00
|
|
|
}
|
2012-08-06 14:34:08 -05:00
|
|
|
match (a, a) { //~ ERROR non-exhaustive patterns
|
2012-08-03 21:59:04 -05:00
|
|
|
(a, b) => {}
|
|
|
|
(b, a) => {}
|
2012-04-24 04:13:25 -05:00
|
|
|
}
|
2012-08-06 14:34:08 -05:00
|
|
|
match a { //~ ERROR b not covered
|
2012-08-03 21:59:04 -05:00
|
|
|
a => {}
|
2012-05-03 10:35:12 -05:00
|
|
|
}
|
2012-04-24 04:13:25 -05:00
|
|
|
// This is exhaustive, though the algorithm got it wrong at one point
|
2012-08-06 14:34:08 -05:00
|
|
|
match (a, b) {
|
2012-08-03 21:59:04 -05:00
|
|
|
(a, _) => {}
|
|
|
|
(_, a) => {}
|
|
|
|
(b, b) => {}
|
2012-04-24 04:13:25 -05:00
|
|
|
}
|
2012-02-15 02:40:42 -06:00
|
|
|
}
|