"incompatible arm" diagnostic span tweak
Use span label instead of span note for single line spans in "incompatible arm" diagnostic.
This commit is contained in:
parent
4a7c072fa6
commit
fed4fcb318
6 changed files with 23 additions and 22 deletions
|
|
@ -6,17 +6,14 @@ error[E0308]: match arms have incompatible types
|
|||
14 | | //~| expected type `bool`
|
||||
15 | | //~| found type `()`
|
||||
... |
|
||||
19 | | None => (),
|
||||
| | -- match arm with an incompatible type
|
||||
20 | | _ => true
|
||||
21 | | }
|
||||
| |_____^ expected bool, found ()
|
||||
|
|
||||
= note: expected type `bool`
|
||||
found type `()`
|
||||
note: match arm with an incompatible type
|
||||
--> $DIR/issue-11319.rs:19:20
|
||||
|
|
||||
19 | None => (),
|
||||
| ^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ error[E0308]: match arms have incompatible types
|
|||
19 | | //~^ ERROR match arms have incompatible types
|
||||
20 | | 1 => |c| c + 1,
|
||||
21 | | 2 => |c| c - 1,
|
||||
| | --------- match arm with an incompatible type
|
||||
22 | | _ => |c| c - 1
|
||||
23 | | };
|
||||
| |_____^ expected closure, found a different closure
|
||||
|
|
@ -25,11 +26,6 @@ error[E0308]: match arms have incompatible types
|
|||
found type `[closure@$DIR/issue-24036.rs:21:14: 21:23]`
|
||||
= note: no two closures, even if identical, have the same type
|
||||
= help: consider boxing your closure and/or using it as a trait object
|
||||
note: match arm with an incompatible type
|
||||
--> $DIR/issue-24036.rs:21:14
|
||||
|
|
||||
21 | 2 => |c| c - 1,
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ error[E0308]: match arms have incompatible types
|
|||
| _____________^
|
||||
19 | | 0 => x,
|
||||
20 | | _ => y,
|
||||
| | - match arm with an incompatible type
|
||||
21 | | };
|
||||
| |_____^ expected bound lifetime parameter, found concrete lifetime
|
||||
|
|
||||
|
|
@ -12,11 +13,6 @@ error[E0308]: match arms have incompatible types
|
|||
found type `for<'a> fn(&'a u8, &'a u8)`
|
||||
= note: this was previously accepted by the compiler but has been phased out
|
||||
= note: for more information, see https://github.com/rust-lang/rust/issues/45852
|
||||
note: match arm with an incompatible type
|
||||
--> $DIR/old-lub-glb-hr.rs:20:14
|
||||
|
|
||||
20 | _ => y,
|
||||
| ^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ error[E0308]: match arms have incompatible types
|
|||
| _____________^
|
||||
21 | | 0 => x,
|
||||
22 | | _ => y,
|
||||
| | - match arm with an incompatible type
|
||||
23 | | };
|
||||
| |_____^ expected bound lifetime parameter 'a, found concrete lifetime
|
||||
|
|
||||
|
|
@ -12,11 +13,6 @@ error[E0308]: match arms have incompatible types
|
|||
found type `&for<'a> Foo<&'a u8, &'a u8>`
|
||||
= note: this was previously accepted by the compiler but has been phased out
|
||||
= note: for more information, see https://github.com/rust-lang/rust/issues/45852
|
||||
note: match arm with an incompatible type
|
||||
--> $DIR/old-lub-glb-object.rs:22:14
|
||||
|
|
||||
22 | _ => y,
|
||||
| ^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue