11error: this argument is passed by value, but not consumed in the function body
2- --> $DIR/needless_pass_by_value.rs:16 :23
2+ --> $DIR/needless_pass_by_value.rs:17 :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:30 :11
10+ --> $DIR/needless_pass_by_value.rs:31 :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:30 :22
16+ --> $DIR/needless_pass_by_value.rs:31 :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:36 :71
22+ --> $DIR/needless_pass_by_value.rs:37 :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:48 :18
28+ --> $DIR/needless_pass_by_value.rs:49 :18
2929 |
3030LL | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
3131 | ^^^^^^^^^^^^^^^^^^^^^^
@@ -36,13 +36,13 @@ LL | match *x {
3636 |
3737
3838error: this argument is passed by value, but not consumed in the function body
39- --> $DIR/needless_pass_by_value.rs:61 :24
39+ --> $DIR/needless_pass_by_value.rs:62 :24
4040 |
4141LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
4242 | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
4343
4444error: this argument is passed by value, but not consumed in the function body
45- --> $DIR/needless_pass_by_value.rs:61 :36
45+ --> $DIR/needless_pass_by_value.rs:62 :36
4646 |
4747LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
4848 | ^^^^^^^
@@ -55,19 +55,19 @@ LL | let Wrapper(_) = *y; // still not moved
5555 |
5656
5757error: this argument is passed by value, but not consumed in the function body
58- --> $DIR/needless_pass_by_value.rs:77 :49
58+ --> $DIR/needless_pass_by_value.rs:78 :49
5959 |
6060LL | fn test_blanket_ref<T: Foo, S: Serialize>(_foo: T, _serializable: S) {}
6161 | ^ help: consider taking a reference instead: `&T`
6262
6363error: this argument is passed by value, but not consumed in the function body
64- --> $DIR/needless_pass_by_value.rs:79 :18
64+ --> $DIR/needless_pass_by_value.rs:80 :18
6565 |
6666LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
6767 | ^^^^^^ help: consider taking a reference instead: `&String`
6868
6969error: this argument is passed by value, but not consumed in the function body
70- --> $DIR/needless_pass_by_value.rs:79 :29
70+ --> $DIR/needless_pass_by_value.rs:80 :29
7171 |
7272LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
7373 | ^^^^^^
@@ -81,13 +81,13 @@ LL | let _ = t.to_string();
8181 | ^^^^^^^^^^^^^
8282
8383error: this argument is passed by value, but not consumed in the function body
84- --> $DIR/needless_pass_by_value.rs:79 :40
84+ --> $DIR/needless_pass_by_value.rs:80 :40
8585 |
8686LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
8787 | ^^^^^^^^ help: consider taking a reference instead: `&Vec<i32>`
8888
8989error: this argument is passed by value, but not consumed in the function body
90- --> $DIR/needless_pass_by_value.rs:79 :53
90+ --> $DIR/needless_pass_by_value.rs:80 :53
9191 |
9292LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
9393 | ^^^^^^^^
@@ -101,61 +101,61 @@ LL | let _ = v.to_owned();
101101 | ^^^^^^^^^^^^
102102
103103error: this argument is passed by value, but not consumed in the function body
104- --> $DIR/needless_pass_by_value.rs:92 :12
104+ --> $DIR/needless_pass_by_value.rs:93 :12
105105 |
106106LL | s: String,
107107 | ^^^^^^ help: consider changing the type to: `&str`
108108
109109error: this argument is passed by value, but not consumed in the function body
110- --> $DIR/needless_pass_by_value.rs:93 :12
110+ --> $DIR/needless_pass_by_value.rs:94 :12
111111 |
112112LL | t: String,
113113 | ^^^^^^ help: consider taking a reference instead: `&String`
114114
115115error: this argument is passed by value, but not consumed in the function body
116- --> $DIR/needless_pass_by_value.rs:102 :23
116+ --> $DIR/needless_pass_by_value.rs:103 :23
117117 |
118118LL | fn baz(&self, _u: U, _s: Self) {}
119119 | ^ help: consider taking a reference instead: `&U`
120120
121121error: this argument is passed by value, but not consumed in the function body
122- --> $DIR/needless_pass_by_value.rs:102 :30
122+ --> $DIR/needless_pass_by_value.rs:103 :30
123123 |
124124LL | fn baz(&self, _u: U, _s: Self) {}
125125 | ^^^^ help: consider taking a reference instead: `&Self`
126126
127127error: this argument is passed by value, but not consumed in the function body
128- --> $DIR/needless_pass_by_value.rs:124 :24
128+ --> $DIR/needless_pass_by_value.rs:125 :24
129129 |
130130LL | fn bar_copy(x: u32, y: CopyWrapper) {
131131 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
132132 |
133133help: consider marking this type as Copy
134- --> $DIR/needless_pass_by_value.rs:122 :1
134+ --> $DIR/needless_pass_by_value.rs:123 :1
135135 |
136136LL | struct CopyWrapper(u32);
137137 | ^^^^^^^^^^^^^^^^^^^^^^^^
138138
139139error: this argument is passed by value, but not consumed in the function body
140- --> $DIR/needless_pass_by_value.rs:130 :29
140+ --> $DIR/needless_pass_by_value.rs:131 :29
141141 |
142142LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
143143 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
144144 |
145145help: consider marking this type as Copy
146- --> $DIR/needless_pass_by_value.rs:122 :1
146+ --> $DIR/needless_pass_by_value.rs:123 :1
147147 |
148148LL | struct CopyWrapper(u32);
149149 | ^^^^^^^^^^^^^^^^^^^^^^^^
150150
151151error: this argument is passed by value, but not consumed in the function body
152- --> $DIR/needless_pass_by_value.rs:130 :45
152+ --> $DIR/needless_pass_by_value.rs:131 :45
153153 |
154154LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
155155 | ^^^^^^^^^^^
156156 |
157157help: consider marking this type as Copy
158- --> $DIR/needless_pass_by_value.rs:122 :1
158+ --> $DIR/needless_pass_by_value.rs:123 :1
159159 |
160160LL | struct CopyWrapper(u32);
161161 | ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -168,13 +168,13 @@ LL | let CopyWrapper(_) = *y; // still not moved
168168 |
169169
170170error: this argument is passed by value, but not consumed in the function body
171- --> $DIR/needless_pass_by_value.rs:130 :61
171+ --> $DIR/needless_pass_by_value.rs:131 :61
172172 |
173173LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
174174 | ^^^^^^^^^^^
175175 |
176176help: consider marking this type as Copy
177- --> $DIR/needless_pass_by_value.rs:122 :1
177+ --> $DIR/needless_pass_by_value.rs:123 :1
178178 |
179179LL | struct CopyWrapper(u32);
180180 | ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -185,13 +185,13 @@ LL | let CopyWrapper(s) = *z; // moved
185185 |
186186
187187error: this argument is passed by value, but not consumed in the function body
188- --> $DIR/needless_pass_by_value.rs:142 :40
188+ --> $DIR/needless_pass_by_value.rs:143 :40
189189 |
190190LL | fn some_fun<'b, S: Bar<'b, ()>>(_item: S) {}
191191 | ^ help: consider taking a reference instead: `&S`
192192
193193error: this argument is passed by value, but not consumed in the function body
194- --> $DIR/needless_pass_by_value.rs:147 :20
194+ --> $DIR/needless_pass_by_value.rs:148 :20
195195 |
196196LL | fn more_fun(_item: impl Club<'static, i32>) {}
197197 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&impl Club<'static, i32>`
0 commit comments