diff --git a/clippy_lints/src/loops/infinite_loop.rs b/clippy_lints/src/loops/infinite_loop.rs index 858e3be5093ef..64ae080701528 100644 --- a/clippy_lints/src/loops/infinite_loop.rs +++ b/clippy_lints/src/loops/infinite_loop.rs @@ -112,7 +112,7 @@ impl<'hir> Visitor<'hir> for LoopVisitor<'hir, '_> { ExprKind::Loop(..) => { self.loop_depth += 1; walk_expr(self, ex); - self.loop_depth = self.loop_depth.saturating_sub(1); + self.loop_depth -= 1; }, _ => { // Calls to a function that never return