summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/iterator_step_by_zero.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/tools/clippy/tests/ui/iterator_step_by_zero.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/iterator_step_by_zero.stderr')
-rw-r--r--src/tools/clippy/tests/ui/iterator_step_by_zero.stderr46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/iterator_step_by_zero.stderr b/src/tools/clippy/tests/ui/iterator_step_by_zero.stderr
new file mode 100644
index 000000000..d792aea11
--- /dev/null
+++ b/src/tools/clippy/tests/ui/iterator_step_by_zero.stderr
@@ -0,0 +1,46 @@
+error: `Iterator::step_by(0)` will panic at runtime
+ --> $DIR/iterator_step_by_zero.rs:3:13
+ |
+LL | let _ = vec!["A", "B", "B"].iter().step_by(0);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `-D clippy::iterator-step-by-zero` implied by `-D warnings`
+
+error: `Iterator::step_by(0)` will panic at runtime
+ --> $DIR/iterator_step_by_zero.rs:4:13
+ |
+LL | let _ = "XXX".chars().step_by(0);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: `Iterator::step_by(0)` will panic at runtime
+ --> $DIR/iterator_step_by_zero.rs:5:13
+ |
+LL | let _ = (0..1).step_by(0);
+ | ^^^^^^^^^^^^^^^^^
+
+error: `Iterator::step_by(0)` will panic at runtime
+ --> $DIR/iterator_step_by_zero.rs:14:13
+ |
+LL | let _ = (1..).step_by(0);
+ | ^^^^^^^^^^^^^^^^
+
+error: `Iterator::step_by(0)` will panic at runtime
+ --> $DIR/iterator_step_by_zero.rs:15:13
+ |
+LL | let _ = (1..=2).step_by(0);
+ | ^^^^^^^^^^^^^^^^^^
+
+error: `Iterator::step_by(0)` will panic at runtime
+ --> $DIR/iterator_step_by_zero.rs:18:13
+ |
+LL | let _ = x.step_by(0);
+ | ^^^^^^^^^^^^
+
+error: `Iterator::step_by(0)` will panic at runtime
+ --> $DIR/iterator_step_by_zero.rs:22:13
+ |
+LL | let _ = v1.iter().step_by(2 / 3);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 7 previous errors
+