about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/needless_range_loop.stderr
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-05 02:01:50 +0000
committerbors <bors@rust-lang.org>2025-09-05 02:01:50 +0000
commit91edc3ebccc4daa46c20a93f4709862376da1fdd (patch)
tree63e75231cb63d011d54d9cd3e771fb4b91eb81da /src/tools/clippy/tests/ui/needless_range_loop.stderr
parentb3cfb8faf84c5f3b7909479a9f9b6a3290d5f4d7 (diff)
parent75b9ee5f085f695cba061fd9ed7fa3b912dd1bbf (diff)
downloadrust-91edc3ebccc4daa46c20a93f4709862376da1fdd.tar.gz
rust-91edc3ebccc4daa46c20a93f4709862376da1fdd.zip
Auto merge of #146218 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
Diffstat (limited to 'src/tools/clippy/tests/ui/needless_range_loop.stderr')
-rw-r--r--src/tools/clippy/tests/ui/needless_range_loop.stderr26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/tools/clippy/tests/ui/needless_range_loop.stderr b/src/tools/clippy/tests/ui/needless_range_loop.stderr
index 23c085f9d3b..33a519d8a80 100644
--- a/src/tools/clippy/tests/ui/needless_range_loop.stderr
+++ b/src/tools/clippy/tests/ui/needless_range_loop.stderr
@@ -168,5 +168,29 @@ LL -     for i in 0..vec.len() {
 LL +     for (i, <item>) in vec.iter_mut().enumerate() {
    |
 
-error: aborting due to 14 previous errors
+error: the loop variable `i` is used to index `a`
+  --> tests/ui/needless_range_loop.rs:235:14
+   |
+LL |     for i in 0..MAX_LEN {
+   |              ^^^^^^^^^^
+   |
+help: consider using an iterator and enumerate()
+   |
+LL -     for i in 0..MAX_LEN {
+LL +     for (i, <item>) in a.iter().enumerate().take(MAX_LEN) {
+   |
+
+error: the loop variable `i` is only used to index `a`
+  --> tests/ui/needless_range_loop.rs:240:14
+   |
+LL |     for i in 0..MAX_LEN {
+   |              ^^^^^^^^^^
+   |
+help: consider using an iterator
+   |
+LL -     for i in 0..MAX_LEN {
+LL +     for <item> in a.iter().take(MAX_LEN) {
+   |
+
+error: aborting due to 16 previous errors