Point at function name span
This commit is contained in:
parent
1f65dc0770
commit
f62f540b4e
17 changed files with 132 additions and 77 deletions
|
|
@ -20,7 +20,9 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-10536.rs:11:15
|
||||
|
|
||||
LL | pub fn main() {
|
||||
| ^ expected bool, found ()
|
||||
| ---- ^ expected bool, found ()
|
||||
| |
|
||||
| this function's body doesn't return the expected type
|
||||
|
|
||||
= note: expected type `bool`
|
||||
found type `()`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-32323.rs:5:30
|
||||
|
|
||||
LL | pub fn f<'a, T: Tr<'a>>() -> <T as Tr<'a>>::Out {}
|
||||
| ^^^^^^^^^^^^^^^^^^ expected associated type, found ()
|
||||
| - ^^^^^^^^^^^^^^^^^^ expected associated type, found ()
|
||||
| |
|
||||
| this function's body doesn't return the expected type
|
||||
|
|
||||
= note: expected type `<T as Tr<'a>>::Out`
|
||||
found type `()`
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-43162.rs:1:13
|
||||
|
|
||||
LL | fn foo() -> bool {
|
||||
| ^^^^ expected bool, found ()
|
||||
| --- ^^^^ expected bool, found ()
|
||||
| |
|
||||
| this function's body doesn't return the expected type
|
||||
LL | //~^ ERROR E0308
|
||||
LL | break true; //~ ERROR E0268
|
||||
| - help: consider removing this semicolon
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-44023.rs:5:36
|
||||
|
|
||||
LL | fn საჭმელად_გემრიელი_სადილი ( ) -> isize { //~ ERROR mismatched types
|
||||
| ^^^^^ expected isize, found ()
|
||||
| ------------------------ ^^^^^ expected isize, found ()
|
||||
| |
|
||||
| this function's body doesn't return the expected type
|
||||
|
|
||||
= note: expected type `isize`
|
||||
found type `()`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-6458-4.rs:1:20
|
||||
|
|
||||
LL | fn foo(b: bool) -> Result<bool,String> { //~ ERROR mismatched types
|
||||
| ^^^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found ()
|
||||
| --- ^^^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found ()
|
||||
| |
|
||||
| this function's body doesn't return the expected type
|
||||
LL | Err("bar".to_string());
|
||||
| - help: consider removing this semicolon
|
||||
|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue