9e934e2215
- Point at the body expression of the match arm with the type error. - Point at the prior match arms explicitely stating the evaluated type. - Point at the entire match expr in a secondary span, instead of primary. - For type errors in the first match arm, the cause is outside of the match, treat as implicit block error to give a more appropriate error.
15 lines
431 B
Rust
15 lines
431 B
Rust
fn main() {
|
|
match Some(10) {
|
|
//~^ NOTE `match` arms have incompatible types
|
|
Some(5) => false,
|
|
//~^ NOTE this is found to be of type `bool`
|
|
Some(2) => true,
|
|
//~^ NOTE this is found to be of type `bool`
|
|
None => (),
|
|
//~^ ERROR match arms have incompatible types
|
|
//~| NOTE expected bool, found ()
|
|
//~| NOTE expected type `bool`
|
|
_ => true
|
|
}
|
|
}
|