Remove a clippy test that doesn't apply anymore

This commit is contained in:
Michael Goulet 2024-04-17 19:54:06 -04:00
parent bc6b70f1d1
commit bd0d306c14
3 changed files with 26 additions and 34 deletions

View File

@ -11,7 +11,6 @@ fn main() {
let _ = vec![1, 2, 3].into_iter(); let _ = vec![1, 2, 3].into_iter();
let _ = (&vec![1, 2, 3]).iter(); //~ ERROR: equivalent to `.iter() let _ = (&vec![1, 2, 3]).iter(); //~ ERROR: equivalent to `.iter()
let _ = vec![1, 2, 3].into_boxed_slice().iter(); //~ ERROR: equivalent to `.iter()
let _ = std::rc::Rc::from(&[X][..]).iter(); //~ ERROR: equivalent to `.iter() let _ = std::rc::Rc::from(&[X][..]).iter(); //~ ERROR: equivalent to `.iter()
let _ = std::sync::Arc::from(&[X][..]).iter(); //~ ERROR: equivalent to `.iter() let _ = std::sync::Arc::from(&[X][..]).iter(); //~ ERROR: equivalent to `.iter()

View File

@ -11,7 +11,6 @@ fn main() {
let _ = vec![1, 2, 3].into_iter(); let _ = vec![1, 2, 3].into_iter();
let _ = (&vec![1, 2, 3]).into_iter(); //~ ERROR: equivalent to `.iter() let _ = (&vec![1, 2, 3]).into_iter(); //~ ERROR: equivalent to `.iter()
let _ = vec![1, 2, 3].into_boxed_slice().into_iter(); //~ ERROR: equivalent to `.iter()
let _ = std::rc::Rc::from(&[X][..]).into_iter(); //~ ERROR: equivalent to `.iter() let _ = std::rc::Rc::from(&[X][..]).into_iter(); //~ ERROR: equivalent to `.iter()
let _ = std::sync::Arc::from(&[X][..]).into_iter(); //~ ERROR: equivalent to `.iter() let _ = std::sync::Arc::from(&[X][..]).into_iter(); //~ ERROR: equivalent to `.iter()

View File

@ -8,160 +8,154 @@ LL | let _ = (&vec![1, 2, 3]).into_iter();
= help: to override `-D warnings` add `#[allow(clippy::into_iter_on_ref)]` = help: to override `-D warnings` add `#[allow(clippy::into_iter_on_ref)]`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
--> tests/ui/into_iter_on_ref.rs:14:46 --> tests/ui/into_iter_on_ref.rs:14:41
|
LL | let _ = vec![1, 2, 3].into_boxed_slice().into_iter();
| ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
--> tests/ui/into_iter_on_ref.rs:15:41
| |
LL | let _ = std::rc::Rc::from(&[X][..]).into_iter(); LL | let _ = std::rc::Rc::from(&[X][..]).into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
--> tests/ui/into_iter_on_ref.rs:16:44 --> tests/ui/into_iter_on_ref.rs:15:44
| |
LL | let _ = std::sync::Arc::from(&[X][..]).into_iter(); LL | let _ = std::sync::Arc::from(&[X][..]).into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `array` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `array`
--> tests/ui/into_iter_on_ref.rs:18:32 --> tests/ui/into_iter_on_ref.rs:17:32
| |
LL | let _ = (&&&&&&&[1, 2, 3]).into_iter(); LL | let _ = (&&&&&&&[1, 2, 3]).into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `array` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `array`
--> tests/ui/into_iter_on_ref.rs:19:36 --> tests/ui/into_iter_on_ref.rs:18:36
| |
LL | let _ = (&&&&mut &&&[1, 2, 3]).into_iter(); LL | let _ = (&&&&mut &&&[1, 2, 3]).into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `array` error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `array`
--> tests/ui/into_iter_on_ref.rs:20:40 --> tests/ui/into_iter_on_ref.rs:19:40
| |
LL | let _ = (&mut &mut &mut [1, 2, 3]).into_iter(); LL | let _ = (&mut &mut &mut [1, 2, 3]).into_iter();
| ^^^^^^^^^ help: call directly: `iter_mut` | ^^^^^^^^^ help: call directly: `iter_mut`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Option` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Option`
--> tests/ui/into_iter_on_ref.rs:22:24 --> tests/ui/into_iter_on_ref.rs:21:24
| |
LL | let _ = (&Some(4)).into_iter(); LL | let _ = (&Some(4)).into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `Option` error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `Option`
--> tests/ui/into_iter_on_ref.rs:23:28 --> tests/ui/into_iter_on_ref.rs:22:28
| |
LL | let _ = (&mut Some(5)).into_iter(); LL | let _ = (&mut Some(5)).into_iter();
| ^^^^^^^^^ help: call directly: `iter_mut` | ^^^^^^^^^ help: call directly: `iter_mut`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Result` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Result`
--> tests/ui/into_iter_on_ref.rs:24:32 --> tests/ui/into_iter_on_ref.rs:23:32
| |
LL | let _ = (&Ok::<_, i32>(6)).into_iter(); LL | let _ = (&Ok::<_, i32>(6)).into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `Result` error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `Result`
--> tests/ui/into_iter_on_ref.rs:25:37 --> tests/ui/into_iter_on_ref.rs:24:37
| |
LL | let _ = (&mut Err::<i32, _>(7)).into_iter(); LL | let _ = (&mut Err::<i32, _>(7)).into_iter();
| ^^^^^^^^^ help: call directly: `iter_mut` | ^^^^^^^^^ help: call directly: `iter_mut`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`
--> tests/ui/into_iter_on_ref.rs:26:34 --> tests/ui/into_iter_on_ref.rs:25:34
| |
LL | let _ = (&Vec::<i32>::new()).into_iter(); LL | let _ = (&Vec::<i32>::new()).into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `Vec` error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `Vec`
--> tests/ui/into_iter_on_ref.rs:27:38 --> tests/ui/into_iter_on_ref.rs:26:38
| |
LL | let _ = (&mut Vec::<i32>::new()).into_iter(); LL | let _ = (&mut Vec::<i32>::new()).into_iter();
| ^^^^^^^^^ help: call directly: `iter_mut` | ^^^^^^^^^ help: call directly: `iter_mut`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `BTreeMap` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `BTreeMap`
--> tests/ui/into_iter_on_ref.rs:28:44 --> tests/ui/into_iter_on_ref.rs:27:44
| |
LL | let _ = (&BTreeMap::<i32, u64>::new()).into_iter(); LL | let _ = (&BTreeMap::<i32, u64>::new()).into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `BTreeMap` error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `BTreeMap`
--> tests/ui/into_iter_on_ref.rs:29:48 --> tests/ui/into_iter_on_ref.rs:28:48
| |
LL | let _ = (&mut BTreeMap::<i32, u64>::new()).into_iter(); LL | let _ = (&mut BTreeMap::<i32, u64>::new()).into_iter();
| ^^^^^^^^^ help: call directly: `iter_mut` | ^^^^^^^^^ help: call directly: `iter_mut`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `VecDeque` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `VecDeque`
--> tests/ui/into_iter_on_ref.rs:30:39 --> tests/ui/into_iter_on_ref.rs:29:39
| |
LL | let _ = (&VecDeque::<i32>::new()).into_iter(); LL | let _ = (&VecDeque::<i32>::new()).into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `VecDeque` error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `VecDeque`
--> tests/ui/into_iter_on_ref.rs:31:43 --> tests/ui/into_iter_on_ref.rs:30:43
| |
LL | let _ = (&mut VecDeque::<i32>::new()).into_iter(); LL | let _ = (&mut VecDeque::<i32>::new()).into_iter();
| ^^^^^^^^^ help: call directly: `iter_mut` | ^^^^^^^^^ help: call directly: `iter_mut`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `LinkedList` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `LinkedList`
--> tests/ui/into_iter_on_ref.rs:32:41 --> tests/ui/into_iter_on_ref.rs:31:41
| |
LL | let _ = (&LinkedList::<i32>::new()).into_iter(); LL | let _ = (&LinkedList::<i32>::new()).into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `LinkedList` error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `LinkedList`
--> tests/ui/into_iter_on_ref.rs:33:45 --> tests/ui/into_iter_on_ref.rs:32:45
| |
LL | let _ = (&mut LinkedList::<i32>::new()).into_iter(); LL | let _ = (&mut LinkedList::<i32>::new()).into_iter();
| ^^^^^^^^^ help: call directly: `iter_mut` | ^^^^^^^^^ help: call directly: `iter_mut`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `HashMap` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `HashMap`
--> tests/ui/into_iter_on_ref.rs:34:43 --> tests/ui/into_iter_on_ref.rs:33:43
| |
LL | let _ = (&HashMap::<i32, u64>::new()).into_iter(); LL | let _ = (&HashMap::<i32, u64>::new()).into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `HashMap` error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `HashMap`
--> tests/ui/into_iter_on_ref.rs:35:47 --> tests/ui/into_iter_on_ref.rs:34:47
| |
LL | let _ = (&mut HashMap::<i32, u64>::new()).into_iter(); LL | let _ = (&mut HashMap::<i32, u64>::new()).into_iter();
| ^^^^^^^^^ help: call directly: `iter_mut` | ^^^^^^^^^ help: call directly: `iter_mut`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `BTreeSet` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `BTreeSet`
--> tests/ui/into_iter_on_ref.rs:37:39 --> tests/ui/into_iter_on_ref.rs:36:39
| |
LL | let _ = (&BTreeSet::<i32>::new()).into_iter(); LL | let _ = (&BTreeSet::<i32>::new()).into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `BinaryHeap` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `BinaryHeap`
--> tests/ui/into_iter_on_ref.rs:38:41 --> tests/ui/into_iter_on_ref.rs:37:41
| |
LL | let _ = (&BinaryHeap::<i32>::new()).into_iter(); LL | let _ = (&BinaryHeap::<i32>::new()).into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `HashSet` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `HashSet`
--> tests/ui/into_iter_on_ref.rs:39:38 --> tests/ui/into_iter_on_ref.rs:38:38
| |
LL | let _ = (&HashSet::<i32>::new()).into_iter(); LL | let _ = (&HashSet::<i32>::new()).into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Path` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Path`
--> tests/ui/into_iter_on_ref.rs:40:43 --> tests/ui/into_iter_on_ref.rs:39:43
| |
LL | let _ = std::path::Path::new("12/34").into_iter(); LL | let _ = std::path::Path::new("12/34").into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `PathBuf` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `PathBuf`
--> tests/ui/into_iter_on_ref.rs:41:47 --> tests/ui/into_iter_on_ref.rs:40:47
| |
LL | let _ = std::path::PathBuf::from("12/34").into_iter(); LL | let _ = std::path::PathBuf::from("12/34").into_iter();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `array` error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `array`
--> tests/ui/into_iter_on_ref.rs:43:26 --> tests/ui/into_iter_on_ref.rs:42:26
| |
LL | let _ = (&[1, 2, 3]).into_iter().next(); LL | let _ = (&[1, 2, 3]).into_iter().next();
| ^^^^^^^^^ help: call directly: `iter` | ^^^^^^^^^ help: call directly: `iter`
error: aborting due to 27 previous errors error: aborting due to 26 previous errors