]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/for_loop.stderr
Auto merge of #4478 - tsurai:master, r=flip1995
[rust.git] / tests / ui / for_loop.stderr
index 257a05c02e0ec327f3454cad068724237ad02e50..0f84abf45ed7592c063ea91f506b68d0a412407b 100644 (file)
@@ -152,5 +152,17 @@ LL |     for _v in vec.iter().next() {}
    |
    = note: `-D clippy::iter-next-loop` implied by `-D warnings`
 
-error: aborting due to 21 previous errors
+error: the loop variable `i` is only used to index `vec`.
+  --> $DIR/for_loop.rs:281:14
+   |
+LL |     for i in ZERO..vec.len() {
+   |              ^^^^^^^^^^^^^^^
+   |
+   = note: `-D clippy::needless-range-loop` implied by `-D warnings`
+help: consider using an iterator
+   |
+LL |     for <item> in &vec {
+   |         ^^^^^^    ^^^^
+
+error: aborting due to 22 previous errors