Point at function name span

This commit is contained in:
Esteban Küber 2018-12-30 15:41:19 -08:00
parent 1f65dc0770
commit f62f540b4e
17 changed files with 132 additions and 77 deletions

View file

@ -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 `()`

View file

@ -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 `()`

View file

@ -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

View file

@ -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 `()`

View file

@ -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
|