1 error: this argument is passed by value, but not consumed in the function body
2 --> $DIR/needless_pass_by_value.rs:17:23
4 LL | 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:31:11
12 LL | 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:31:22
18 LL | 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:37:71
24 LL | 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:49:18
30 LL | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
31 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&Option<Option<String>>`
33 error: this argument is passed by value, but not consumed in the function body
34 --> $DIR/needless_pass_by_value.rs:62:24
36 LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
37 | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
39 error: this argument is passed by value, but not consumed in the function body
40 --> $DIR/needless_pass_by_value.rs:62:36
42 LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
43 | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
45 error: this argument is passed by value, but not consumed in the function body
46 --> $DIR/needless_pass_by_value.rs:78:49
48 LL | fn test_blanket_ref<T: Foo, S: Serialize>(_foo: T, _serializable: S) {}
49 | ^ help: consider taking a reference instead: `&T`
51 error: this argument is passed by value, but not consumed in the function body
52 --> $DIR/needless_pass_by_value.rs:80:18
54 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
55 | ^^^^^^ help: consider taking a reference instead: `&String`
57 error: this argument is passed by value, but not consumed in the function body
58 --> $DIR/needless_pass_by_value.rs:80:29
60 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
63 help: consider changing the type to
65 LL | fn issue_2114(s: String, t: &str, u: Vec<i32>, v: Vec<i32>) {
67 help: change `t.clone()` to
69 LL | let _ = t.to_string();
72 error: this argument is passed by value, but not consumed in the function body
73 --> $DIR/needless_pass_by_value.rs:80:40
75 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
76 | ^^^^^^^^ help: consider taking a reference instead: `&Vec<i32>`
78 error: this argument is passed by value, but not consumed in the function body
79 --> $DIR/needless_pass_by_value.rs:80:53
81 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
84 help: consider changing the type to
86 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: &[i32]) {
88 help: change `v.clone()` to
90 LL | let _ = v.to_owned();
93 error: this argument is passed by value, but not consumed in the function body
94 --> $DIR/needless_pass_by_value.rs:93:12
97 | ^^^^^^ help: consider changing the type to: `&str`
99 error: this argument is passed by value, but not consumed in the function body
100 --> $DIR/needless_pass_by_value.rs:94:12
103 | ^^^^^^ help: consider taking a reference instead: `&String`
105 error: this argument is passed by value, but not consumed in the function body
106 --> $DIR/needless_pass_by_value.rs:103:23
108 LL | fn baz(&self, _u: U, _s: Self) {}
109 | ^ help: consider taking a reference instead: `&U`
111 error: this argument is passed by value, but not consumed in the function body
112 --> $DIR/needless_pass_by_value.rs:103:30
114 LL | fn baz(&self, _u: U, _s: Self) {}
115 | ^^^^ help: consider taking a reference instead: `&Self`
117 error: this argument is passed by value, but not consumed in the function body
118 --> $DIR/needless_pass_by_value.rs:125:24
120 LL | fn bar_copy(x: u32, y: CopyWrapper) {
121 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
123 help: consider marking this type as Copy
124 --> $DIR/needless_pass_by_value.rs:123:1
126 LL | struct CopyWrapper(u32);
127 | ^^^^^^^^^^^^^^^^^^^^^^^^
129 error: this argument is passed by value, but not consumed in the function body
130 --> $DIR/needless_pass_by_value.rs:131:29
132 LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
133 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
135 help: consider marking this type as Copy
136 --> $DIR/needless_pass_by_value.rs:123:1
138 LL | struct CopyWrapper(u32);
139 | ^^^^^^^^^^^^^^^^^^^^^^^^
141 error: this argument is passed by value, but not consumed in the function body
142 --> $DIR/needless_pass_by_value.rs:131:45
144 LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
145 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
147 help: consider marking this type as Copy
148 --> $DIR/needless_pass_by_value.rs:123:1
150 LL | struct CopyWrapper(u32);
151 | ^^^^^^^^^^^^^^^^^^^^^^^^
153 error: this argument is passed by value, but not consumed in the function body
154 --> $DIR/needless_pass_by_value.rs:131:61
156 LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
157 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
159 help: consider marking this type as Copy
160 --> $DIR/needless_pass_by_value.rs:123:1
162 LL | struct CopyWrapper(u32);
163 | ^^^^^^^^^^^^^^^^^^^^^^^^
165 error: this argument is passed by value, but not consumed in the function body
166 --> $DIR/needless_pass_by_value.rs:143:40
168 LL | fn some_fun<'b, S: Bar<'b, ()>>(_item: S) {}
169 | ^ help: consider taking a reference instead: `&S`
171 error: this argument is passed by value, but not consumed in the function body
172 --> $DIR/needless_pass_by_value.rs:148:20
174 LL | fn more_fun(_item: impl Club<'static, i32>) {}
175 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&impl Club<'static, i32>`
177 error: aborting due to 22 previous errors