We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 01f299b commit f5ef301Copy full SHA for f5ef301
clippy_tests/examples/range.rs
@@ -21,4 +21,7 @@ fn main() {
21
let v2 = vec![4,5];
22
let _x = v1.iter().zip(0..v1.len());
23
let _y = v1.iter().zip(0..v2.len()); // No error
24
+
25
+ // check const eval
26
+ let _ = v1.iter().step_by(2/3);
27
}
clippy_tests/examples/range.stderr
@@ -6,7 +6,15 @@ error: It is more idiomatic to use v1.iter().enumerate()
6
|
7
= note: `-D range-zip-with-len` implied by `-D warnings`
8
9
-error: aborting due to previous error
+error: Iterator::step_by(0) will panic at runtime
10
+ --> range.rs:26:13
11
+ |
12
+26 | let _ = v1.iter().step_by(2/3);
13
+ | ^^^^^^^^^^^^^^^^^^^^^^
14
15
+ = note: `-D iterator-step-by-zero` implied by `-D warnings`
16
17
+error: aborting due to 2 previous errors
18
19
20
To learn more, run the command again with --verbose.
0 commit comments