Skip to content

Commit c420382

Browse files
committed
Auto merge of #5738 - mikerite:loops-20200623-2, r=matthiaskrgr
Improve end of expression check in for loop lints changelog: none
2 parents 9504efc + 52c4864 commit c420382

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/loops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2042,7 +2042,7 @@ impl<'a, 'tcx> Visitor<'tcx> for InitializeVisitor<'a, 'tcx> {
20422042
if self.state == VarState::DontWarn {
20432043
return;
20442044
}
2045-
if SpanlessEq::new(self.cx).eq_expr(&expr, self.end_expr) {
2045+
if expr.hir_id == self.end_expr.hir_id {
20462046
self.past_loop = true;
20472047
return;
20482048
}

0 commit comments

Comments
 (0)