Closed
Description
let _ = match Some(42) {
Some(x) => {
x
}
None => {
0;
}
};
we emit
error[E0308]: `match` arms have incompatible types
--> src/main.rs:6:17
|
2 | let _ = match Some(42) {
| _____________-
3 | | Some(x) => {
4 | | x
| | - this is found to be of type `{integer}`
5 | | }
6 | | None => {
| |_________________^
7 | || 0;
8 | || }
| ||_________^ expected integer, found `()`
9 | | };
| |_____- `match` arms have incompatible types
We should be
- checking that removing the
;
in the incompatible arm would solve the issue and suggest it - point at the last statement in the incompatible arm instead of the whole arm