Closed as not planned
Description
let x = &Some((3, 3));
match x {
Some((x, 3)) | &Some((ref x, 5)) => {
}
_ => {
}
}
error[E0409]: variable `x` is bound inconsistently across alternatives separated by `|`
--> src/bin/chapter4.rs:111:39
|
111 | Some((x, 3)) | &Some((ref x, 5)) => {
| - first binding ^ bound in different ways
error: aborting due to previous error
For more information about this error, try `rustc --explain E0409`.
The x type in both patterns is &u32
, but the compiler will report inconsistency in the types in both patterns.