1 error: non-binding let on a type that implements `Drop`
2 --> $DIR/map_clone.rs:10:5
4 LL | let _: Vec<i8> = vec![5_i8; 6].iter().map(|x| *x).collect();
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 = note: `-D clippy::let-underscore-drop` implied by `-D warnings`
8 = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
10 error: you are using an explicit closure for copying elements
11 --> $DIR/map_clone.rs:10:22
13 LL | let _: Vec<i8> = vec![5_i8; 6].iter().map(|x| *x).collect();
14 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `vec![5_i8; 6].iter().copied()`
16 = note: `-D clippy::map-clone` implied by `-D warnings`
18 error: non-binding let on a type that implements `Drop`
19 --> $DIR/map_clone.rs:11:5
21 LL | let _: Vec<String> = vec![String::new()].iter().map(|x| x.clone()).collect();
22 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24 = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
26 error: you are using an explicit closure for cloning elements
27 --> $DIR/map_clone.rs:11:26
29 LL | let _: Vec<String> = vec![String::new()].iter().map(|x| x.clone()).collect();
30 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `vec![String::new()].iter().cloned()`
32 error: non-binding let on a type that implements `Drop`
33 --> $DIR/map_clone.rs:12:5
35 LL | let _: Vec<u32> = vec![42, 43].iter().map(|&x| x).collect();
36 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38 = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
40 error: you are using an explicit closure for copying elements
41 --> $DIR/map_clone.rs:12:23
43 LL | let _: Vec<u32> = vec![42, 43].iter().map(|&x| x).collect();
44 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `vec![42, 43].iter().copied()`
46 error: you are using an explicit closure for copying elements
47 --> $DIR/map_clone.rs:14:26
49 LL | let _: Option<u64> = Some(&16).map(|b| *b);
50 | ^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `Some(&16).copied()`
52 error: you are using an explicit closure for copying elements
53 --> $DIR/map_clone.rs:15:25
55 LL | let _: Option<u8> = Some(&1).map(|x| x.clone());
56 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `Some(&1).copied()`
58 error: you are needlessly cloning iterator elements
59 --> $DIR/map_clone.rs:26:29
61 LL | let _ = std::env::args().map(|v| v.clone());
62 | ^^^^^^^^^^^^^^^^^^^ help: remove the `map` call
64 error: non-binding let on a type that implements `Drop`
65 --> $DIR/map_clone.rs:35:9
67 LL | let _: Vec<u32> = v.into_iter().map(|x| *x).collect();
68 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
70 = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
72 error: non-binding let on a type that implements `Drop`
73 --> $DIR/map_clone.rs:42:9
75 LL | let _: Vec<u32> = v.into_iter().map(|x| *x).collect();
76 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78 = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
80 error: non-binding let on a type that implements `Drop`
81 --> $DIR/map_clone.rs:45:9
83 LL | let _: Vec<u32> = v.into_iter().map(|&mut x| x).collect();
84 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86 = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
88 error: non-binding let on a type that implements `Drop`
89 --> $DIR/map_clone.rs:53:9
91 LL | let _: Vec<_> = items.into_iter().map(|x| x.clone()).collect();
92 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94 = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
96 error: aborting due to 13 previous errors