From 5915850071da4dc48ce9b9a4469c522d75cd6f6c Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 11 Apr 2024 12:41:03 -0400 Subject: [PATCH] No need to pass parent of block for BlockTailExpression --- compiler/rustc_hir_typeck/src/coercion.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_hir_typeck/src/coercion.rs b/compiler/rustc_hir_typeck/src/coercion.rs index 8a6a33304e6..4896781683c 100644 --- a/compiler/rustc_hir_typeck/src/coercion.rs +++ b/compiler/rustc_hir_typeck/src/coercion.rs @@ -1591,14 +1591,13 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> { err.span_label(cause.span, "return type is not `()`"); } ObligationCauseCode::BlockTailExpression(blk_id, ..) => { - let parent_id = fcx.tcx.parent_hir_id(blk_id); err = self.report_return_mismatched_types( cause, expected, found, coercion_error, fcx, - parent_id, + blk_id, expression, Some(blk_id), );