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