1 error: this argument is passed by value, but not consumed in the function body
2 --> $DIR/needless_pass_by_value.rs:24:23
4 24 | fn foo<T: Default>(v: Vec<T>, w: Vec<T>, mut x: Vec<T>, y: Vec<T>) -> Vec<T> {
5 | ^^^^^^ help: consider changing the type to: `&[T]`
7 = note: `-D clippy::needless-pass-by-value` implied by `-D warnings`
9 error: this argument is passed by value, but not consumed in the function body
10 --> $DIR/needless_pass_by_value.rs:38:11
12 38 | fn bar(x: String, y: Wrapper) {
13 | ^^^^^^ help: consider changing the type to: `&str`
15 error: this argument is passed by value, but not consumed in the function body
16 --> $DIR/needless_pass_by_value.rs:38:22
18 38 | fn bar(x: String, y: Wrapper) {
19 | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
21 error: this argument is passed by value, but not consumed in the function body
22 --> $DIR/needless_pass_by_value.rs:44:71
24 44 | fn test_borrow_trait<T: Borrow<str>, U: AsRef<str>, V>(t: T, u: U, v: V) {
25 | ^ help: consider taking a reference instead: `&V`
27 error: this argument is passed by value, but not consumed in the function body
28 --> $DIR/needless_pass_by_value.rs:56:18
30 56 | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
31 | ^^^^^^^^^^^^^^^^^^^^^^
32 help: consider taking a reference instead
34 56 | fn test_match(x: &Option<Option<String>>, y: Option<Option<String>>) {
38 error: this argument is passed by value, but not consumed in the function body
39 --> $DIR/needless_pass_by_value.rs:69:24
41 69 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
42 | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
44 error: this argument is passed by value, but not consumed in the function body
45 --> $DIR/needless_pass_by_value.rs:69:36
47 69 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
49 help: consider taking a reference instead
51 69 | fn test_destructure(x: Wrapper, y: &Wrapper, z: Wrapper) {
52 70 | let Wrapper(s) = z; // moved
53 71 | let Wrapper(ref t) = *y; // not moved
54 72 | let Wrapper(_) = *y; // still not moved
57 error: this argument is passed by value, but not consumed in the function body
58 --> $DIR/needless_pass_by_value.rs:85:49
60 85 | fn test_blanket_ref<T: Foo, S: Serialize>(_foo: T, _serializable: S) {}
61 | ^ help: consider taking a reference instead: `&T`
63 error: this argument is passed by value, but not consumed in the function body
64 --> $DIR/needless_pass_by_value.rs:87:18
66 87 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
67 | ^^^^^^ help: consider taking a reference instead: `&String`
69 error: this argument is passed by value, but not consumed in the function body
70 --> $DIR/needless_pass_by_value.rs:87:29
72 87 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
74 help: consider changing the type to
76 87 | fn issue_2114(s: String, t: &str, u: Vec<i32>, v: Vec<i32>) {
78 help: change `t.clone()` to
80 89 | let _ = t.to_string();
83 error: this argument is passed by value, but not consumed in the function body
84 --> $DIR/needless_pass_by_value.rs:87:40
86 87 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
87 | ^^^^^^^^ help: consider taking a reference instead: `&Vec<i32>`
89 error: this argument is passed by value, but not consumed in the function body
90 --> $DIR/needless_pass_by_value.rs:87:53
92 87 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
94 help: consider changing the type to
96 87 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: &[i32]) {
98 help: change `v.clone()` to
100 91 | let _ = v.to_owned();
103 error: this argument is passed by value, but not consumed in the function body
104 --> $DIR/needless_pass_by_value.rs:100:12
107 | ^^^^^^ help: consider changing the type to: `&str`
109 error: this argument is passed by value, but not consumed in the function body
110 --> $DIR/needless_pass_by_value.rs:101:12
113 | ^^^^^^ help: consider taking a reference instead: `&String`
115 error: this argument is passed by value, but not consumed in the function body
116 --> $DIR/needless_pass_by_value.rs:110:23
118 110 | fn baz(&self, _u: U, _s: Self) {}
119 | ^ help: consider taking a reference instead: `&U`
121 error: this argument is passed by value, but not consumed in the function body
122 --> $DIR/needless_pass_by_value.rs:110:30
124 110 | fn baz(&self, _u: U, _s: Self) {}
125 | ^^^^ help: consider taking a reference instead: `&Self`
127 error: this argument is passed by value, but not consumed in the function body
128 --> $DIR/needless_pass_by_value.rs:132:24
130 132 | fn bar_copy(x: u32, y: CopyWrapper) {
131 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
133 help: consider marking this type as Copy
134 --> $DIR/needless_pass_by_value.rs:130:1
136 130 | struct CopyWrapper(u32);
137 | ^^^^^^^^^^^^^^^^^^^^^^^^
139 error: this argument is passed by value, but not consumed in the function body
140 --> $DIR/needless_pass_by_value.rs:138:29
142 138 | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
143 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
145 help: consider marking this type as Copy
146 --> $DIR/needless_pass_by_value.rs:130:1
148 130 | struct CopyWrapper(u32);
149 | ^^^^^^^^^^^^^^^^^^^^^^^^
151 error: this argument is passed by value, but not consumed in the function body
152 --> $DIR/needless_pass_by_value.rs:138:45
154 138 | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
157 help: consider marking this type as Copy
158 --> $DIR/needless_pass_by_value.rs:130:1
160 130 | struct CopyWrapper(u32);
161 | ^^^^^^^^^^^^^^^^^^^^^^^^
162 help: consider taking a reference instead
164 138 | fn test_destructure_copy(x: CopyWrapper, y: &CopyWrapper, z: CopyWrapper) {
165 139 | let CopyWrapper(s) = z; // moved
166 140 | let CopyWrapper(ref t) = *y; // not moved
167 141 | let CopyWrapper(_) = *y; // still not moved
170 error: this argument is passed by value, but not consumed in the function body
171 --> $DIR/needless_pass_by_value.rs:138:61
173 138 | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
176 help: consider marking this type as Copy
177 --> $DIR/needless_pass_by_value.rs:130:1
179 130 | struct CopyWrapper(u32);
180 | ^^^^^^^^^^^^^^^^^^^^^^^^
181 help: consider taking a reference instead
183 138 | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: &CopyWrapper) {
184 139 | let CopyWrapper(s) = *z; // moved
187 error: this argument is passed by value, but not consumed in the function body
188 --> $DIR/needless_pass_by_value.rs:150:40
190 150 | fn some_fun<'b, S: Bar<'b, ()>>(_item: S) {}
191 | ^ help: consider taking a reference instead: `&S`
193 error: this argument is passed by value, but not consumed in the function body
194 --> $DIR/needless_pass_by_value.rs:155:20
196 155 | fn more_fun(_item: impl Club<'static, i32>) {}
197 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&impl Club<'static, i32>`
199 error: aborting due to 22 previous errors