explicit_counter_loop fix #3308 false positive

This commit is contained in:
Josh Mcguigan
2018-10-13 06:57:52 -07:00
parent 8b12eee112
commit c6f79c7ba0
2 changed files with 36 additions and 4 deletions

View File

@@ -1952,10 +1952,7 @@ impl<'a, 'tcx> Visitor<'tcx> for IncrementVisitor<'a, 'tcx> {
_ => (),
}
}
} else if is_loop(expr) {
walk_expr(self, expr);
return;
} else if is_conditional(expr) {
} else if is_loop(expr) || is_conditional(expr) {
self.depth += 1;
walk_expr(self, expr);
self.depth -= 1;