11error: this argument is passed by value, but not consumed in the function body
2- --> $DIR/needless_pass_by_value.rs:17 :23
2+ --> $DIR/needless_pass_by_value.rs:18 :23
33 |
44LL | fn foo<T: Default>(v: Vec<T>, w: Vec<T>, mut x: Vec<T>, y: Vec<T>) -> Vec<T> {
55 | ^^^^^^ help: consider changing the type to: `&[T]`
66 |
77 = note: `-D clippy::needless-pass-by-value` implied by `-D warnings`
88
99error: this argument is passed by value, but not consumed in the function body
10- --> $DIR/needless_pass_by_value.rs:31 :11
10+ --> $DIR/needless_pass_by_value.rs:32 :11
1111 |
1212LL | fn bar(x: String, y: Wrapper) {
1313 | ^^^^^^ help: consider changing the type to: `&str`
1414
1515error: this argument is passed by value, but not consumed in the function body
16- --> $DIR/needless_pass_by_value.rs:31 :22
16+ --> $DIR/needless_pass_by_value.rs:32 :22
1717 |
1818LL | fn bar(x: String, y: Wrapper) {
1919 | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
2020
2121error: this argument is passed by value, but not consumed in the function body
22- --> $DIR/needless_pass_by_value.rs:37 :71
22+ --> $DIR/needless_pass_by_value.rs:38 :71
2323 |
2424LL | fn test_borrow_trait<T: Borrow<str>, U: AsRef<str>, V>(t: T, u: U, v: V) {
2525 | ^ help: consider taking a reference instead: `&V`
2626
2727error: this argument is passed by value, but not consumed in the function body
28- --> $DIR/needless_pass_by_value.rs:49 :18
28+ --> $DIR/needless_pass_by_value.rs:50 :18
2929 |
3030LL | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
3131 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&Option<Option<String>>`
3232
3333error: this argument is passed by value, but not consumed in the function body
34- --> $DIR/needless_pass_by_value.rs:62 :24
34+ --> $DIR/needless_pass_by_value.rs:63 :24
3535 |
3636LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
3737 | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
3838
3939error: this argument is passed by value, but not consumed in the function body
40- --> $DIR/needless_pass_by_value.rs:62 :36
40+ --> $DIR/needless_pass_by_value.rs:63 :36
4141 |
4242LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
4343 | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
4444
4545error: this argument is passed by value, but not consumed in the function body
46- --> $DIR/needless_pass_by_value.rs:78 :49
46+ --> $DIR/needless_pass_by_value.rs:79 :49
4747 |
4848LL | fn test_blanket_ref<T: Foo, S: Serialize>(_foo: T, _serializable: S) {}
4949 | ^ help: consider taking a reference instead: `&T`
5050
5151error: this argument is passed by value, but not consumed in the function body
52- --> $DIR/needless_pass_by_value.rs:80 :18
52+ --> $DIR/needless_pass_by_value.rs:81 :18
5353 |
5454LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
5555 | ^^^^^^ help: consider taking a reference instead: `&String`
5656
5757error: this argument is passed by value, but not consumed in the function body
58- --> $DIR/needless_pass_by_value.rs:80 :29
58+ --> $DIR/needless_pass_by_value.rs:81 :29
5959 |
6060LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
6161 | ^^^^^^
@@ -70,13 +70,13 @@ LL | let _ = t.to_string();
7070 | ^^^^^^^^^^^^^
7171
7272error: this argument is passed by value, but not consumed in the function body
73- --> $DIR/needless_pass_by_value.rs:80 :40
73+ --> $DIR/needless_pass_by_value.rs:81 :40
7474 |
7575LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
7676 | ^^^^^^^^ help: consider taking a reference instead: `&Vec<i32>`
7777
7878error: this argument is passed by value, but not consumed in the function body
79- --> $DIR/needless_pass_by_value.rs:80 :53
79+ --> $DIR/needless_pass_by_value.rs:81 :53
8080 |
8181LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
8282 | ^^^^^^^^
@@ -91,85 +91,85 @@ LL | let _ = v.to_owned();
9191 | ^^^^^^^^^^^^
9292
9393error: this argument is passed by value, but not consumed in the function body
94- --> $DIR/needless_pass_by_value.rs:93 :12
94+ --> $DIR/needless_pass_by_value.rs:94 :12
9595 |
9696LL | s: String,
9797 | ^^^^^^ help: consider changing the type to: `&str`
9898
9999error: this argument is passed by value, but not consumed in the function body
100- --> $DIR/needless_pass_by_value.rs:94 :12
100+ --> $DIR/needless_pass_by_value.rs:95 :12
101101 |
102102LL | t: String,
103103 | ^^^^^^ help: consider taking a reference instead: `&String`
104104
105105error: this argument is passed by value, but not consumed in the function body
106- --> $DIR/needless_pass_by_value.rs:103 :23
106+ --> $DIR/needless_pass_by_value.rs:104 :23
107107 |
108108LL | fn baz(&self, _u: U, _s: Self) {}
109109 | ^ help: consider taking a reference instead: `&U`
110110
111111error: this argument is passed by value, but not consumed in the function body
112- --> $DIR/needless_pass_by_value.rs:103 :30
112+ --> $DIR/needless_pass_by_value.rs:104 :30
113113 |
114114LL | fn baz(&self, _u: U, _s: Self) {}
115115 | ^^^^ help: consider taking a reference instead: `&Self`
116116
117117error: this argument is passed by value, but not consumed in the function body
118- --> $DIR/needless_pass_by_value.rs:125 :24
118+ --> $DIR/needless_pass_by_value.rs:126 :24
119119 |
120120LL | fn bar_copy(x: u32, y: CopyWrapper) {
121121 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
122122 |
123123help: consider marking this type as Copy
124- --> $DIR/needless_pass_by_value.rs:123 :1
124+ --> $DIR/needless_pass_by_value.rs:124 :1
125125 |
126126LL | struct CopyWrapper(u32);
127127 | ^^^^^^^^^^^^^^^^^^^^^^^^
128128
129129error: this argument is passed by value, but not consumed in the function body
130- --> $DIR/needless_pass_by_value.rs:131 :29
130+ --> $DIR/needless_pass_by_value.rs:132 :29
131131 |
132132LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
133133 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
134134 |
135135help: consider marking this type as Copy
136- --> $DIR/needless_pass_by_value.rs:123 :1
136+ --> $DIR/needless_pass_by_value.rs:124 :1
137137 |
138138LL | struct CopyWrapper(u32);
139139 | ^^^^^^^^^^^^^^^^^^^^^^^^
140140
141141error: this argument is passed by value, but not consumed in the function body
142- --> $DIR/needless_pass_by_value.rs:131 :45
142+ --> $DIR/needless_pass_by_value.rs:132 :45
143143 |
144144LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
145145 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
146146 |
147147help: consider marking this type as Copy
148- --> $DIR/needless_pass_by_value.rs:123 :1
148+ --> $DIR/needless_pass_by_value.rs:124 :1
149149 |
150150LL | struct CopyWrapper(u32);
151151 | ^^^^^^^^^^^^^^^^^^^^^^^^
152152
153153error: this argument is passed by value, but not consumed in the function body
154- --> $DIR/needless_pass_by_value.rs:131 :61
154+ --> $DIR/needless_pass_by_value.rs:132 :61
155155 |
156156LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
157157 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
158158 |
159159help: consider marking this type as Copy
160- --> $DIR/needless_pass_by_value.rs:123 :1
160+ --> $DIR/needless_pass_by_value.rs:124 :1
161161 |
162162LL | struct CopyWrapper(u32);
163163 | ^^^^^^^^^^^^^^^^^^^^^^^^
164164
165165error: this argument is passed by value, but not consumed in the function body
166- --> $DIR/needless_pass_by_value.rs:143 :40
166+ --> $DIR/needless_pass_by_value.rs:144 :40
167167 |
168168LL | fn some_fun<'b, S: Bar<'b, ()>>(_item: S) {}
169169 | ^ help: consider taking a reference instead: `&S`
170170
171171error: this argument is passed by value, but not consumed in the function body
172- --> $DIR/needless_pass_by_value.rs:148 :20
172+ --> $DIR/needless_pass_by_value.rs:149 :20
173173 |
174174LL | fn more_fun(_item: impl Club<'static, i32>) {}
175175 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&impl Club<'static, i32>`
0 commit comments