2012-01-19 18:31:08 -08:00
|
|
|
enum t { a, b, }
|
2010-12-02 14:50:00 -08:00
|
|
|
|
2012-02-15 09:40:42 +01:00
|
|
|
fn main() {
|
|
|
|
let x = a;
|
2012-08-06 12:34:08 -07:00
|
|
|
match x { b => { } } //~ ERROR non-exhaustive patterns
|
|
|
|
match true { //~ ERROR non-exhaustive patterns
|
2012-08-03 19:59:04 -07:00
|
|
|
true => {}
|
2012-02-15 09:40:42 +01:00
|
|
|
}
|
2012-08-20 12:23:37 -07:00
|
|
|
match @Some(10) { //~ ERROR non-exhaustive patterns
|
|
|
|
@None => {}
|
2012-02-15 09:40:42 +01:00
|
|
|
}
|
2012-08-06 12:34:08 -07:00
|
|
|
match (2, 3, 4) { //~ ERROR non-exhaustive patterns
|
2012-08-03 19:59:04 -07:00
|
|
|
(_, _, 4) => {}
|
2012-02-15 09:40:42 +01:00
|
|
|
}
|
2012-08-06 12:34:08 -07:00
|
|
|
match (a, a) { //~ ERROR non-exhaustive patterns
|
2012-08-03 19:59:04 -07:00
|
|
|
(a, b) => {}
|
|
|
|
(b, a) => {}
|
2012-04-24 11:13:25 +02:00
|
|
|
}
|
2012-08-06 12:34:08 -07:00
|
|
|
match a { //~ ERROR b not covered
|
2012-08-03 19:59:04 -07:00
|
|
|
a => {}
|
2012-05-03 17:35:12 +02:00
|
|
|
}
|
2012-04-24 11:13:25 +02:00
|
|
|
// This is exhaustive, though the algorithm got it wrong at one point
|
2012-08-06 12:34:08 -07:00
|
|
|
match (a, b) {
|
2012-08-03 19:59:04 -07:00
|
|
|
(a, _) => {}
|
|
|
|
(_, a) => {}
|
|
|
|
(b, b) => {}
|
2012-04-24 11:13:25 +02:00
|
|
|
}
|
2012-02-15 09:40:42 +01:00
|
|
|
}
|