2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
struct A(isize);
|
2014-05-20 20:20:26 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = match A(3) {
|
2015-01-25 15:05:03 -06:00
|
|
|
A(..) => 1
|
2014-05-20 20:20:26 -05:00
|
|
|
};
|
|
|
|
assert_eq!(x, 1);
|
|
|
|
let x = match A(4) {
|
2015-01-25 15:05:03 -06:00
|
|
|
A(1) => 1,
|
|
|
|
A(..) => 2
|
2014-05-20 20:20:26 -05:00
|
|
|
};
|
|
|
|
assert_eq!(x, 2);
|
|
|
|
}
|