- if !is_lint_allowed(cx, IF_SAME_THEN_ELSE, win0.hir_id);
- if !is_lint_allowed(cx, IF_SAME_THEN_ELSE, win1.hir_id);
+ // `conds` may have one last item than `blocks`.
+ // Any `i` from `blocks.windows(2)` will exist in `conds`, but `i+1` may not exist on the last iteration.
+ if !matches!(conds[i].kind, ExprKind::Let(..));
+ if !matches!(conds.get(i + 1).map(|e| &e.kind), Some(ExprKind::Let(..)));
+ if !is_lint_allowed(cx, IF_SAME_THEN_ELSE, block0.hir_id);
+ if !is_lint_allowed(cx, IF_SAME_THEN_ELSE, block1.hir_id);