Auto merge of #5738 - mikerite:loops-20200623-2, r=matthiaskrgr

Improve end of expression check in for loop lints

changelog: none
This commit is contained in:
bors
2020-06-23 14:05:45 +00:00
+1 -1
View File
@@ -2042,7 +2042,7 @@ fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {
if self.state == VarState::DontWarn {
return;
}
if SpanlessEq::new(self.cx).eq_expr(&expr, self.end_expr) {
if expr.hir_id == self.end_expr.hir_id {
self.past_loop = true;
return;
}