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