File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -738,18 +738,17 @@ declare_clippy_lint! {
738738}
739739
740740declare_clippy_lint ! {
741- /// **What it does:** Checks for calling `.step_by(0)` on iterators,
742- /// which never terminates.
741+ /// **What it does:** Checks for calling `.step_by(0)` on iterators which panics.
743742 ///
744- /// **Why is this bad?** This very much looks like an oversight, since with
745- /// `loop { .. }` there is an obvious better way to endlessly loop .
743+ /// **Why is this bad?** This very much looks like an oversight. Use `panic!()` instead if you
744+ /// actually intend to panic .
746745 ///
747746 /// **Known problems:** None.
748747 ///
749748 /// **Example:**
750- /// ```ignore
751- /// for x in (5..5 ).step_by(0) {
752- /// ..
749+ /// ```should_panic
750+ /// for x in (0..100 ).step_by(0) {
751+ /// // ..
753752 /// }
754753 /// ```
755754 pub ITERATOR_STEP_BY_ZERO ,
You can’t perform that action at this time.
0 commit comments