1 An "or" pattern was used where the variable bindings are not consistently bound
4 Erroneous code example:
9 (0, ref y) | (y, 0) => { /* use y */} // error: variable `y` is bound with
10 // different mode in pattern #2
16 Here, `y` is bound by-value in one case and by-reference in the other.
18 To fix this error, just use the same mode in both cases.
19 Generally using `ref` or `ref mut` where not already used will fix this:
24 (0, ref y) | (ref y, 0) => { /* use y */}
29 Alternatively, split the pattern:
34 (y, 0) => { /* use y */ }
35 (0, ref y) => { /* use y */}