Point more places where expectation comes from
This commit is contained in:
parent
90507295db
commit
19255dc2e6
@ -1246,9 +1246,7 @@ impl<'gcx, 'tcx, 'exprs, E> CoerceMany<'gcx, 'tcx, 'exprs, E>
|
||||
let parent = fcx.tcx.hir().get(fcx.tcx.hir().get_parent_node(parent_id));
|
||||
if fcx.get_node_fn_decl(parent).is_some() {
|
||||
if let Some(sp) = fcx.ret_coercion_span.borrow().as_ref() {
|
||||
if !sp.overlaps(cause.span) {
|
||||
db.span_label(*sp, reason_label);
|
||||
}
|
||||
db.span_label(*sp, reason_label);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,10 @@ error[E0308]: mismatched types
|
||||
LL | fn f() -> isize {
|
||||
| ----- expected `isize` because of return type
|
||||
LL | (return 1, return 2) //~ ERROR mismatched types
|
||||
| ^^^^^^^^^^^^^^^^^^^^ expected isize, found tuple
|
||||
| ^^^^^^^^^^^^^^^^^^-^
|
||||
| | |
|
||||
| | expected because of this statement
|
||||
| expected isize, found tuple
|
||||
|
|
||||
= note: expected type `isize`
|
||||
found type `(!, !)`
|
||||
|
@ -4,7 +4,10 @@ error[E0308]: mismatched types
|
||||
LL | fn f() -> isize {
|
||||
| ----- expected `isize` because of return type
|
||||
LL | (return 1, return 2)
|
||||
| ^^^^^^^^^^^^^^^^^^^^ expected isize, found tuple
|
||||
| ^^^^^^^^^^^^^^^^^^-^
|
||||
| | |
|
||||
| | expected because of this statement
|
||||
| expected isize, found tuple
|
||||
|
|
||||
= note: expected type `isize`
|
||||
found type `(!, !)`
|
||||
|
@ -25,6 +25,7 @@ error[E0308]: mismatched types
|
||||
LL | / if false {
|
||||
LL | | //~^ ERROR mismatched types
|
||||
LL | | return 0i32;
|
||||
| | ---- expected because of this statement
|
||||
LL | | } else {
|
||||
LL | | 1u32
|
||||
LL | | }
|
||||
|
Loading…
x
Reference in New Issue
Block a user