]> git.proxmox.com Git - rustc.git/blame - src/librustc_error_codes/error_codes/E0416.md
New upstream version 1.41.1+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0416.md
CommitLineData
60c5eb7d
XL
1An identifier is bound more than once in a pattern.
2
3Erroneous code example:
4
5```compile_fail,E0416
6match (1, 2) {
7 (x, x) => {} // error: identifier `x` is bound more than once in the
8 // same pattern
9}
10```
11
12Please verify you didn't misspell identifiers' name. Example:
13
14```
15match (1, 2) {
16 (x, y) => {} // ok!
17}
18```
19
20Or maybe did you mean to unify? Consider using a guard:
21
22```
23# let (A, B, C) = (1, 2, 3);
24match (A, B, C) {
25 (x, x2, see) if x == x2 => { /* A and B are equal, do one thing */ }
26 (y, z, see) => { /* A and B unequal; do another thing */ }
27}
28```