about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--clippy_lints/src/methods/mod.rs13
1 files 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,