summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/iter_nth.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/iter_nth.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/iter_nth.stderr')
-rw-r--r--src/tools/clippy/tests/ui/iter_nth.stderr59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/iter_nth.stderr b/src/tools/clippy/tests/ui/iter_nth.stderr
new file mode 100644
index 000000000..d00b2fb67
--- /dev/null
+++ b/src/tools/clippy/tests/ui/iter_nth.stderr
@@ -0,0 +1,59 @@
+error: called `.iter().nth()` on a Vec
+ --> $DIR/iter_nth.rs:33:23
+ |
+LL | let bad_vec = some_vec.iter().nth(3);
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `-D clippy::iter-nth` implied by `-D warnings`
+ = help: calling `.get()` is both faster and more readable
+
+error: called `.iter().nth()` on a slice
+ --> $DIR/iter_nth.rs:34:26
+ |
+LL | let bad_slice = &some_vec[..].iter().nth(3);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: calling `.get()` is both faster and more readable
+
+error: called `.iter().nth()` on a slice
+ --> $DIR/iter_nth.rs:35:31
+ |
+LL | let bad_boxed_slice = boxed_slice.iter().nth(3);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: calling `.get()` is both faster and more readable
+
+error: called `.iter().nth()` on a VecDeque
+ --> $DIR/iter_nth.rs:36:29
+ |
+LL | let bad_vec_deque = some_vec_deque.iter().nth(3);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: calling `.get()` is both faster and more readable
+
+error: called `.iter_mut().nth()` on a Vec
+ --> $DIR/iter_nth.rs:41:23
+ |
+LL | let bad_vec = some_vec.iter_mut().nth(3);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: calling `.get_mut()` is both faster and more readable
+
+error: called `.iter_mut().nth()` on a slice
+ --> $DIR/iter_nth.rs:44:26
+ |
+LL | let bad_slice = &some_vec[..].iter_mut().nth(3);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: calling `.get_mut()` is both faster and more readable
+
+error: called `.iter_mut().nth()` on a VecDeque
+ --> $DIR/iter_nth.rs:47:29
+ |
+LL | let bad_vec_deque = some_vec_deque.iter_mut().nth(3);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: calling `.get_mut()` is both faster and more readable
+
+error: aborting due to 7 previous errors
+