about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/clippy/tests/ui/bytes_nth.fixed2
-rw-r--r--src/tools/clippy/tests/ui/bytes_nth.rs2
-rw-r--r--src/tools/clippy/tests/ui/bytes_nth.stderr6
-rw-r--r--src/tools/clippy/tests/ui/iter_count.fixed16
-rw-r--r--src/tools/clippy/tests/ui/iter_count.rs16
-rw-r--r--src/tools/clippy/tests/ui/iter_count.stderr18
6 files changed, 30 insertions, 30 deletions
diff --git a/src/tools/clippy/tests/ui/bytes_nth.fixed b/src/tools/clippy/tests/ui/bytes_nth.fixed
index bf68a7bbbf1..46b7833f428 100644
--- a/src/tools/clippy/tests/ui/bytes_nth.fixed
+++ b/src/tools/clippy/tests/ui/bytes_nth.fixed
@@ -6,6 +6,6 @@
 fn main() {
     let s = String::from("String");
     s.as_bytes().get(3);
-    &s.as_bytes().get(3);
+    let _ = &s.as_bytes().get(3);
     s[..].as_bytes().get(3);
 }
diff --git a/src/tools/clippy/tests/ui/bytes_nth.rs b/src/tools/clippy/tests/ui/bytes_nth.rs
index 629812cc02c..c5e983d4d4e 100644
--- a/src/tools/clippy/tests/ui/bytes_nth.rs
+++ b/src/tools/clippy/tests/ui/bytes_nth.rs
@@ -6,6 +6,6 @@
 fn main() {
     let s = String::from("String");
     s.bytes().nth(3);
-    &s.bytes().nth(3);
+    let _ = &s.bytes().nth(3);
     s[..].bytes().nth(3);
 }
diff --git a/src/tools/clippy/tests/ui/bytes_nth.stderr b/src/tools/clippy/tests/ui/bytes_nth.stderr
index 9a5742928cd..536decf5e7f 100644
--- a/src/tools/clippy/tests/ui/bytes_nth.stderr
+++ b/src/tools/clippy/tests/ui/bytes_nth.stderr
@@ -7,10 +7,10 @@ LL |     s.bytes().nth(3);
    = note: `-D clippy::bytes-nth` implied by `-D warnings`
 
 error: called `.byte().nth()` on a `String`
-  --> $DIR/bytes_nth.rs:9:6
+  --> $DIR/bytes_nth.rs:9:14
    |
-LL |     &s.bytes().nth(3);
-   |      ^^^^^^^^^^^^^^^^ help: try: `s.as_bytes().get(3)`
+LL |     let _ = &s.bytes().nth(3);
+   |              ^^^^^^^^^^^^^^^^ help: try: `s.as_bytes().get(3)`
 
 error: called `.byte().nth()` on a `str`
   --> $DIR/bytes_nth.rs:10:5
diff --git a/src/tools/clippy/tests/ui/iter_count.fixed b/src/tools/clippy/tests/ui/iter_count.fixed
index b11dadda6c2..52f833ece69 100644
--- a/src/tools/clippy/tests/ui/iter_count.fixed
+++ b/src/tools/clippy/tests/ui/iter_count.fixed
@@ -3,11 +3,11 @@
 
 #![warn(clippy::iter_count)]
 #![allow(
-    unused_variables,
-    array_into_iter,
-    unused_mut,
-    clippy::into_iter_on_ref,
-    clippy::unnecessary_operation
+unused_variables,
+array_into_iter,
+unused_mut,
+clippy::into_iter_on_ref,
+clippy::unnecessary_operation
 )]
 
 extern crate option_helpers;
@@ -50,7 +50,7 @@ fn main() {
     linked_list.push_back(1);
     binary_heap.push(1);
 
-    &vec[..].len();
+    let _ = &vec[..].len();
     vec.len();
     boxed_slice.len();
     vec_deque.len();
@@ -62,13 +62,13 @@ fn main() {
     binary_heap.len();
 
     vec.len();
-    &vec[..].len();
+    let _ = &vec[..].len();
     vec_deque.len();
     hash_map.len();
     b_tree_map.len();
     linked_list.len();
 
-    &vec[..].len();
+    let _ = &vec[..].len();
     vec.len();
     vec_deque.len();
     hash_set.len();
diff --git a/src/tools/clippy/tests/ui/iter_count.rs b/src/tools/clippy/tests/ui/iter_count.rs
index 7d49c6a3dbb..e76914aa54c 100644
--- a/src/tools/clippy/tests/ui/iter_count.rs
+++ b/src/tools/clippy/tests/ui/iter_count.rs
@@ -3,11 +3,11 @@
 
 #![warn(clippy::iter_count)]
 #![allow(
-    unused_variables,
-    array_into_iter,
-    unused_mut,
-    clippy::into_iter_on_ref,
-    clippy::unnecessary_operation
+unused_variables,
+array_into_iter,
+unused_mut,
+clippy::into_iter_on_ref,
+clippy::unnecessary_operation
 )]
 
 extern crate option_helpers;
@@ -50,7 +50,7 @@ fn main() {
     linked_list.push_back(1);
     binary_heap.push(1);
 
-    &vec[..].iter().count();
+    let _ = &vec[..].iter().count();
     vec.iter().count();
     boxed_slice.iter().count();
     vec_deque.iter().count();
@@ -62,13 +62,13 @@ fn main() {
     binary_heap.iter().count();
 
     vec.iter_mut().count();
-    &vec[..].iter_mut().count();
+    let _ = &vec[..].iter_mut().count();
     vec_deque.iter_mut().count();
     hash_map.iter_mut().count();
     b_tree_map.iter_mut().count();
     linked_list.iter_mut().count();
 
-    &vec[..].into_iter().count();
+    let _ = &vec[..].into_iter().count();
     vec.into_iter().count();
     vec_deque.into_iter().count();
     hash_set.into_iter().count();
diff --git a/src/tools/clippy/tests/ui/iter_count.stderr b/src/tools/clippy/tests/ui/iter_count.stderr
index f3fb98e65b9..1d2c22f9dfa 100644
--- a/src/tools/clippy/tests/ui/iter_count.stderr
+++ b/src/tools/clippy/tests/ui/iter_count.stderr
@@ -1,8 +1,8 @@
 error: called `.iter().count()` on a `slice`
-  --> $DIR/iter_count.rs:53:6
+  --> $DIR/iter_count.rs:53:14
    |
-LL |     &vec[..].iter().count();
-   |      ^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec[..].len()`
+LL |     let _ = &vec[..].iter().count();
+   |              ^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec[..].len()`
    |
    = note: `-D clippy::iter-count` implied by `-D warnings`
 
@@ -67,10 +67,10 @@ LL |     vec.iter_mut().count();
    |     ^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec.len()`
 
 error: called `.iter_mut().count()` on a `slice`
-  --> $DIR/iter_count.rs:65:6
+  --> $DIR/iter_count.rs:65:14
    |
-LL |     &vec[..].iter_mut().count();
-   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec[..].len()`
+LL |     let _ = &vec[..].iter_mut().count();
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec[..].len()`
 
 error: called `.iter_mut().count()` on a `VecDeque`
   --> $DIR/iter_count.rs:66:5
@@ -97,10 +97,10 @@ LL |     linked_list.iter_mut().count();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `linked_list.len()`
 
 error: called `.into_iter().count()` on a `slice`
-  --> $DIR/iter_count.rs:71:6
+  --> $DIR/iter_count.rs:71:14
    |
-LL |     &vec[..].into_iter().count();
-   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec[..].len()`
+LL |     let _ = &vec[..].into_iter().count();
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vec[..].len()`
 
 error: called `.into_iter().count()` on a `Vec`
   --> $DIR/iter_count.rs:72:5