Skip to content

Commit 5915850

Browse files
No need to pass parent of block for BlockTailExpression
1 parent ffdf277 commit 5915850

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/rustc_hir_typeck/src/coercion.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1591,14 +1591,13 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
15911591
err.span_label(cause.span, "return type is not `()`");
15921592
}
15931593
ObligationCauseCode::BlockTailExpression(blk_id, ..) => {
1594-
let parent_id = fcx.tcx.parent_hir_id(blk_id);
15951594
err = self.report_return_mismatched_types(
15961595
cause,
15971596
expected,
15981597
found,
15991598
coercion_error,
16001599
fcx,
1601-
parent_id,
1600+
blk_id,
16021601
expression,
16031602
Some(blk_id),
16041603
);

0 commit comments

Comments
 (0)