]> git.lizzy.rs Git - rust.git/blob - tests/ui/map_clone.stderr
Update references
[rust.git] / tests / ui / map_clone.stderr
1 error: non-binding let on a type that implements `Drop`
2   --> $DIR/map_clone.rs:10:5
3    |
4 LL |     let _: Vec<i8> = vec![5_i8; 6].iter().map(|x| *x).collect();
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
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`
9
10 error: you are using an explicit closure for copying elements
11   --> $DIR/map_clone.rs:10:22
12    |
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()`
15    |
16    = note: `-D clippy::map-clone` implied by `-D warnings`
17
18 error: non-binding let on a type that implements `Drop`
19   --> $DIR/map_clone.rs:11:5
20    |
21 LL |     let _: Vec<String> = vec![String::new()].iter().map(|x| x.clone()).collect();
22    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23    |
24    = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
25
26 error: you are using an explicit closure for cloning elements
27   --> $DIR/map_clone.rs:11:26
28    |
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()`
31
32 error: non-binding let on a type that implements `Drop`
33   --> $DIR/map_clone.rs:12:5
34    |
35 LL |     let _: Vec<u32> = vec![42, 43].iter().map(|&x| x).collect();
36    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37    |
38    = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
39
40 error: you are using an explicit closure for copying elements
41   --> $DIR/map_clone.rs:12:23
42    |
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()`
45
46 error: you are using an explicit closure for copying elements
47   --> $DIR/map_clone.rs:14:26
48    |
49 LL |     let _: Option<u64> = Some(&16).map(|b| *b);
50    |                          ^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `Some(&16).copied()`
51
52 error: you are using an explicit closure for copying elements
53   --> $DIR/map_clone.rs:15:25
54    |
55 LL |     let _: Option<u8> = Some(&1).map(|x| x.clone());
56    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `Some(&1).copied()`
57
58 error: you are needlessly cloning iterator elements
59   --> $DIR/map_clone.rs:26:29
60    |
61 LL |     let _ = std::env::args().map(|v| v.clone());
62    |                             ^^^^^^^^^^^^^^^^^^^ help: remove the `map` call
63
64 error: non-binding let on a type that implements `Drop`
65   --> $DIR/map_clone.rs:35:9
66    |
67 LL |         let _: Vec<u32> = v.into_iter().map(|x| *x).collect();
68    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69    |
70    = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
71
72 error: non-binding let on a type that implements `Drop`
73   --> $DIR/map_clone.rs:42:9
74    |
75 LL |         let _: Vec<u32> = v.into_iter().map(|x| *x).collect();
76    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
77    |
78    = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
79
80 error: non-binding let on a type that implements `Drop`
81   --> $DIR/map_clone.rs:45:9
82    |
83 LL |         let _: Vec<u32> = v.into_iter().map(|&mut x| x).collect();
84    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85    |
86    = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
87
88 error: non-binding let on a type that implements `Drop`
89   --> $DIR/map_clone.rs:53:9
90    |
91 LL |         let _: Vec<_> = items.into_iter().map(|x| x.clone()).collect();
92    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93    |
94    = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
95
96 error: aborting due to 13 previous errors
97