From 38d0b2199a5a945c9ac31cf5d9a96b28869edcb1 Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Wed, 18 Dec 2019 18:59:59 +0200 Subject: [PATCH] Correct `iterator_step_by_zero` documentation --- clippy_lints/src/methods/mod.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index 8e94cc0f002..9b375d59512 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -738,18 +738,17 @@ declare_clippy_lint! { } declare_clippy_lint! { - /// **What it does:** Checks for calling `.step_by(0)` on iterators, - /// which never terminates. + /// **What it does:** Checks for calling `.step_by(0)` on iterators which panics. /// - /// **Why is this bad?** This very much looks like an oversight, since with - /// `loop { .. }` there is an obvious better way to endlessly loop. + /// **Why is this bad?** This very much looks like an oversight. Use `panic!()` instead if you + /// actually intend to panic. /// /// **Known problems:** None. /// /// **Example:** - /// ```ignore - /// for x in (5..5).step_by(0) { - /// .. + /// ```should_panic + /// for x in (0..100).step_by(0) { + /// //.. /// } /// ``` pub ITERATOR_STEP_BY_ZERO,