2016-09-24 17:45:59 +00:00
|
|
|
enum Enum {
|
|
|
|
A, B, C, D, E, F
|
|
|
|
}
|
|
|
|
use Enum::*;
|
|
|
|
|
|
|
|
struct S(Enum, ());
|
|
|
|
struct Sd { x: Enum, y: () }
|
|
|
|
|
|
|
|
fn main() {
|
2017-11-20 12:13:27 +00:00
|
|
|
match (A, ()) { //~ ERROR non-exhaustive
|
2016-09-24 17:45:59 +00:00
|
|
|
(A, _) => {}
|
|
|
|
}
|
|
|
|
|
2017-11-20 12:13:27 +00:00
|
|
|
match (A, A) { //~ ERROR non-exhaustive
|
2016-09-24 17:45:59 +00:00
|
|
|
(_, A) => {}
|
|
|
|
}
|
|
|
|
|
2017-11-20 12:13:27 +00:00
|
|
|
match ((A, ()), ()) { //~ ERROR non-exhaustive
|
2016-09-24 17:45:59 +00:00
|
|
|
((A, ()), _) => {}
|
|
|
|
}
|
|
|
|
|
2017-11-20 12:13:27 +00:00
|
|
|
match ((A, ()), A) { //~ ERROR non-exhaustive
|
2016-09-24 17:45:59 +00:00
|
|
|
((A, ()), _) => {}
|
|
|
|
}
|
|
|
|
|
2017-11-20 12:13:27 +00:00
|
|
|
match ((A, ()), ()) { //~ ERROR non-exhaustive
|
2016-09-24 17:45:59 +00:00
|
|
|
((A, _), _) => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-11-20 12:13:27 +00:00
|
|
|
match S(A, ()) { //~ ERROR non-exhaustive
|
2016-09-24 17:45:59 +00:00
|
|
|
S(A, _) => {}
|
|
|
|
}
|
|
|
|
|
2017-11-20 12:13:27 +00:00
|
|
|
match (Sd { x: A, y: () }) { //~ ERROR non-exhaustive
|
2016-09-24 17:45:59 +00:00
|
|
|
Sd { x: A, y: _ } => {}
|
|
|
|
}
|
|
|
|
|
2017-11-20 12:13:27 +00:00
|
|
|
match Some(A) { //~ ERROR non-exhaustive
|
2016-09-24 17:45:59 +00:00
|
|
|
Some(A) => (),
|
|
|
|
None => ()
|
|
|
|
}
|
|
|
|
}
|