No need to pass parent of block for BlockTailExpression
This commit is contained in:
@@ -1591,14 +1591,13 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
|
|||||||
err.span_label(cause.span, "return type is not `()`");
|
err.span_label(cause.span, "return type is not `()`");
|
||||||
}
|
}
|
||||||
ObligationCauseCode::BlockTailExpression(blk_id, ..) => {
|
ObligationCauseCode::BlockTailExpression(blk_id, ..) => {
|
||||||
let parent_id = fcx.tcx.parent_hir_id(blk_id);
|
|
||||||
err = self.report_return_mismatched_types(
|
err = self.report_return_mismatched_types(
|
||||||
cause,
|
cause,
|
||||||
expected,
|
expected,
|
||||||
found,
|
found,
|
||||||
coercion_error,
|
coercion_error,
|
||||||
fcx,
|
fcx,
|
||||||
parent_id,
|
blk_id,
|
||||||
expression,
|
expression,
|
||||||
Some(blk_id),
|
Some(blk_id),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user