Skip to content

Commit 298ca67

Browse files
committed
review comment: add claryfing comment
1 parent 5021dde commit 298ca67

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_hir_typeck/src/_match.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
147147
}
148148

149149
if !arm_ty.is_never() {
150+
// When a match arm has type `!`, then it doesn't influence the expected type for
151+
// the following arm. If all of the prior arms are `!`, then the influence comes
152+
// from elsewhere and we shouldn't point to any previous arm.
150153
prior_arm = Some((arm_block_id, arm_ty, arm_span));
151154
}
152155
}

0 commit comments

Comments
 (0)