diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/bytes_nth.fixed | 2 | ||||
| -rw-r--r-- | tests/ui/bytes_nth.rs | 2 | ||||
| -rw-r--r-- | tests/ui/bytes_nth.stderr | 6 | ||||
| -rw-r--r-- | tests/ui/crashes/ice-3969.stderr | 6 | ||||
| -rw-r--r-- | tests/ui/iter_count.fixed | 6 | ||||
| -rw-r--r-- | tests/ui/iter_count.rs | 6 | ||||
| -rw-r--r-- | tests/ui/iter_count.stderr | 18 |
7 files changed, 23 insertions, 23 deletions
diff --git a/tests/ui/bytes_nth.fixed b/tests/ui/bytes_nth.fixed index bf68a7bbbf1..46b7833f428 100644 --- a/tests/ui/bytes_nth.fixed +++ b/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/tests/ui/bytes_nth.rs b/tests/ui/bytes_nth.rs index 629812cc02c..c5e983d4d4e 100644 --- a/tests/ui/bytes_nth.rs +++ b/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/tests/ui/bytes_nth.stderr b/tests/ui/bytes_nth.stderr index 9a5742928cd..536decf5e7f 100644 --- a/tests/ui/bytes_nth.stderr +++ b/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/tests/ui/crashes/ice-3969.stderr b/tests/ui/crashes/ice-3969.stderr index fb4589a48ec..8b2c318acf8 100644 --- a/tests/ui/crashes/ice-3969.stderr +++ b/tests/ui/crashes/ice-3969.stderr @@ -5,7 +5,7 @@ LL | for<'a> Dst<A + 'a>: Sized, | ^^^^^^ help: use `dyn`: `dyn A + 'a` | = note: `-D bare-trait-objects` implied by `-D warnings` - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: trait objects without an explicit `dyn` are deprecated @@ -14,7 +14,7 @@ error: trait objects without an explicit `dyn` are deprecated LL | let x: Dst<A> = *(Box::new(Dst { x: 1 }) as Box<Dst<A>>); | ^ help: use `dyn`: `dyn A` | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: trait objects without an explicit `dyn` are deprecated @@ -23,7 +23,7 @@ error: trait objects without an explicit `dyn` are deprecated LL | let x: Dst<A> = *(Box::new(Dst { x: 1 }) as Box<Dst<A>>); | ^ help: use `dyn`: `dyn A` | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition! + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> error: aborting due to 3 previous errors diff --git a/tests/ui/iter_count.fixed b/tests/ui/iter_count.fixed index b11dadda6c2..97c5929783d 100644 --- a/tests/ui/iter_count.fixed +++ b/tests/ui/iter_count.fixed @@ -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/tests/ui/iter_count.rs b/tests/ui/iter_count.rs index 7d49c6a3dbb..70bb734763f 100644 --- a/tests/ui/iter_count.rs +++ b/tests/ui/iter_count.rs @@ -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/tests/ui/iter_count.stderr b/tests/ui/iter_count.stderr index f3fb98e65b9..1d2c22f9dfa 100644 --- a/tests/ui/iter_count.stderr +++ b/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 |
