This commit is contained in:
Michael Wright 2019-07-06 19:43:34 +02:00
parent adcc02ed8a
commit c72be0f65a

View File

@ -483,9 +483,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
// check for never_loop // check for never_loop
if let ExprKind::Loop(ref block, _, _) = expr.node { if let ExprKind::Loop(ref block, _, _) = expr.node {
match never_loop_block(block, expr.hir_id) { match never_loop_block(block, expr.hir_id) {
NeverLoopResult::AlwaysBreak => { NeverLoopResult::AlwaysBreak => span_lint(cx, NEVER_LOOP, expr.span, "this loop never actually loops"),
span_lint(cx, NEVER_LOOP, expr.span, "this loop never actually loops")
},
NeverLoopResult::MayContinueMainLoop | NeverLoopResult::Otherwise => (), NeverLoopResult::MayContinueMainLoop | NeverLoopResult::Otherwise => (),
} }
} }