rust/tests/ui/issues/issue-3038.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
617 B
Rust
Raw Normal View History

enum F { G(isize, isize) }
enum H { I(J, K) }
enum J { L(isize, isize) }
enum K { M(isize, isize) }
fn main()
{
let _z = match F::G(1, 2) {
F::G(x, x) => { println!("{}", x + x); }
//~^ ERROR identifier `x` is bound more than once in the same pattern
};
let _z = match H::I(J::L(1, 2), K::M(3, 4)) {
H::I(J::L(x, _), K::M(_, x))
//~^ ERROR identifier `x` is bound more than once in the same pattern
2014-10-15 01:07:11 +00:00
=> { println!("{}", x + x); }
};
2012-08-06 19:34:08 +00:00
let _z = match (1, 2) {
(x, x) => { x } //~ ERROR identifier `x` is bound more than once in the same pattern
};
}