Skip to content

Commit abaf4db

Browse files
No need to pass parent of block for BlockTailExpression
1 parent 2eb6684 commit abaf4db

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
@@ -1622,14 +1622,13 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
16221622
err.span_label(cause.span, "return type is not `()`");
16231623
}
16241624
ObligationCauseCode::BlockTailExpression(blk_id, ..) => {
1625-
let parent_id = fcx.tcx.parent_hir_id(blk_id);
16261625
err = self.report_return_mismatched_types(
16271626
cause,
16281627
expected,
16291628
found,
16301629
coercion_error,
16311630
fcx,
1632-
parent_id,
1631+
blk_id,
16331632
expression,
16341633
Some(blk_id),
16351634
);

0 commit comments

Comments
 (0)