2018-12-16 22:21:47 -05:00
|
|
|
enum F { G(isize, isize) }
|
2012-07-27 13:03:04 -07:00
|
|
|
|
2018-12-16 22:21:47 -05:00
|
|
|
enum H { I(J, K) }
|
2012-07-27 13:03:04 -07:00
|
|
|
|
2018-12-16 22:21:47 -05:00
|
|
|
enum J { L(isize, isize) }
|
|
|
|
enum K { M(isize, isize) }
|
2012-07-27 13:03:04 -07:00
|
|
|
|
|
|
|
fn main()
|
|
|
|
{
|
|
|
|
|
2018-12-16 22:21:47 -05:00
|
|
|
let _z = match F::G(1, 2) {
|
|
|
|
F::G(x, x) => { println!("{}", x + x); }
|
2014-02-06 10:38:08 +01:00
|
|
|
//~^ ERROR identifier `x` is bound more than once in the same pattern
|
2012-07-27 13:03:04 -07:00
|
|
|
};
|
|
|
|
|
2018-12-16 22:21:47 -05:00
|
|
|
let _z = match H::I(J::L(1, 2), K::M(3, 4)) {
|
|
|
|
H::I(J::L(x, _), K::M(_, x))
|
2014-11-06 00:05:53 -08:00
|
|
|
//~^ ERROR identifier `x` is bound more than once in the same pattern
|
2014-10-14 21:07:11 -04:00
|
|
|
=> { println!("{}", x + x); }
|
2012-07-27 13:03:04 -07:00
|
|
|
};
|
|
|
|
|
2012-08-06 12:34:08 -07:00
|
|
|
let _z = match (1, 2) {
|
2014-02-06 10:38:08 +01:00
|
|
|
(x, x) => { x } //~ ERROR identifier `x` is bound more than once in the same pattern
|
2012-07-27 13:03:04 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|