Skip to content

Commit e239328

Browse files
No need to pass parent of block for BlockTailExpression
1 parent 3c78a4c commit e239328

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/rustc_hir_typeck/src/coercion.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,14 +1619,13 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
16191619
err.span_label(cause.span, "return type is not `()`");
16201620
}
16211621
ObligationCauseCode::BlockTailExpression(blk_id, ..) => {
1622-
let parent_id = fcx.tcx.parent_hir_id(blk_id);
16231622
err = self.report_return_mismatched_types(
16241623
cause,
16251624
expected,
16261625
found,
16271626
coercion_error,
16281627
fcx,
1629-
parent_id,
1628+
blk_id,
16301629
expression,
16311630
Some(blk_id),
16321631
);

0 commit comments

Comments
 (0)