about summary refs log tree commit diff
path: root/src/docs/iterator_step_by_zero.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/docs/iterator_step_by_zero.txt')
-rw-r--r--src/docs/iterator_step_by_zero.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/docs/iterator_step_by_zero.txt b/src/docs/iterator_step_by_zero.txt
new file mode 100644
index 00000000000..73ecc99acfc
--- /dev/null
+++ b/src/docs/iterator_step_by_zero.txt
@@ -0,0 +1,13 @@
+### What it does
+Checks for calling `.step_by(0)` on iterators which panics.
+
+### Why is this bad?
+This very much looks like an oversight. Use `panic!()` instead if you
+actually intend to panic.
+
+### Example
+```
+for x in (0..100).step_by(0) {
+    //..
+}
+```
\ No newline at end of file