From 298ca6732b242a88bc6038d56a0d0b6abac2521a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Mon, 14 Aug 2023 19:27:12 +0000 Subject: [PATCH] review comment: add claryfing comment --- compiler/rustc_hir_typeck/src/_match.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_hir_typeck/src/_match.rs b/compiler/rustc_hir_typeck/src/_match.rs index 5d710239ff35d..7ad9f51ba705d 100644 --- a/compiler/rustc_hir_typeck/src/_match.rs +++ b/compiler/rustc_hir_typeck/src/_match.rs @@ -147,6 +147,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } if !arm_ty.is_never() { + // When a match arm has type `!`, then it doesn't influence the expected type for + // the following arm. If all of the prior arms are `!`, then the influence comes + // from elsewhere and we shouldn't point to any previous arm. prior_arm = Some((arm_block_id, arm_ty, arm_span)); } }