File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -738,18 +738,17 @@ declare_clippy_lint! {
738
738
}
739
739
740
740
declare_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.
743
742
///
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 .
746
745
///
747
746
/// **Known problems:** None.
748
747
///
749
748
/// **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
+ /// // ..
753
752
/// }
754
753
/// ```
755
754
pub ITERATOR_STEP_BY_ZERO ,
You can’t perform that action at this time.
0 commit comments