1
1
error: 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
3
3
|
4
4
LL | fn foo<T: Default>(v: Vec<T>, w: Vec<T>, mut x: Vec<T>, y: Vec<T>) -> Vec<T> {
5
5
| ^^^^^^ help: consider changing the type to: `&[T]`
6
6
|
7
7
= note: `-D clippy::needless-pass-by-value` implied by `-D warnings`
8
8
9
9
error: 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
11
11
|
12
12
LL | fn bar(x: String, y: Wrapper) {
13
13
| ^^^^^^ help: consider changing the type to: `&str`
14
14
15
15
error: 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
17
17
|
18
18
LL | fn bar(x: String, y: Wrapper) {
19
19
| ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
20
20
21
21
error: 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
23
23
|
24
24
LL | fn test_borrow_trait<T: Borrow<str>, U: AsRef<str>, V>(t: T, u: U, v: V) {
25
25
| ^ help: consider taking a reference instead: `&V`
26
26
27
27
error: 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
29
29
|
30
30
LL | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
31
31
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -36,13 +36,13 @@ LL | match *x {
36
36
|
37
37
38
38
error: 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
40
40
|
41
41
LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
42
42
| ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
43
43
44
44
error: 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
46
46
|
47
47
LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
48
48
| ^^^^^^^
@@ -55,19 +55,19 @@ LL | let Wrapper(_) = *y; // still not moved
55
55
|
56
56
57
57
error: 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
59
59
|
60
60
LL | fn test_blanket_ref<T: Foo, S: Serialize>(_foo: T, _serializable: S) {}
61
61
| ^ help: consider taking a reference instead: `&T`
62
62
63
63
error: 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
65
65
|
66
66
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
67
67
| ^^^^^^ help: consider taking a reference instead: `&String`
68
68
69
69
error: 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
71
71
|
72
72
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
73
73
| ^^^^^^
@@ -81,13 +81,13 @@ LL | let _ = t.to_string();
81
81
| ^^^^^^^^^^^^^
82
82
83
83
error: 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
85
85
|
86
86
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
87
87
| ^^^^^^^^ help: consider taking a reference instead: `&Vec<i32>`
88
88
89
89
error: 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
91
91
|
92
92
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
93
93
| ^^^^^^^^
@@ -101,61 +101,61 @@ LL | let _ = v.to_owned();
101
101
| ^^^^^^^^^^^^
102
102
103
103
error: 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
105
105
|
106
106
LL | s: String,
107
107
| ^^^^^^ help: consider changing the type to: `&str`
108
108
109
109
error: 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
111
111
|
112
112
LL | t: String,
113
113
| ^^^^^^ help: consider taking a reference instead: `&String`
114
114
115
115
error: 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
117
117
|
118
118
LL | fn baz(&self, _u: U, _s: Self) {}
119
119
| ^ help: consider taking a reference instead: `&U`
120
120
121
121
error: 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
123
123
|
124
124
LL | fn baz(&self, _u: U, _s: Self) {}
125
125
| ^^^^ help: consider taking a reference instead: `&Self`
126
126
127
127
error: 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
129
129
|
130
130
LL | fn bar_copy(x: u32, y: CopyWrapper) {
131
131
| ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
132
132
|
133
133
help: consider marking this type as Copy
134
- --> $DIR/needless_pass_by_value.rs:122 :1
134
+ --> $DIR/needless_pass_by_value.rs:123 :1
135
135
|
136
136
LL | struct CopyWrapper(u32);
137
137
| ^^^^^^^^^^^^^^^^^^^^^^^^
138
138
139
139
error: 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
141
141
|
142
142
LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
143
143
| ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
144
144
|
145
145
help: consider marking this type as Copy
146
- --> $DIR/needless_pass_by_value.rs:122 :1
146
+ --> $DIR/needless_pass_by_value.rs:123 :1
147
147
|
148
148
LL | struct CopyWrapper(u32);
149
149
| ^^^^^^^^^^^^^^^^^^^^^^^^
150
150
151
151
error: 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
153
153
|
154
154
LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
155
155
| ^^^^^^^^^^^
156
156
|
157
157
help: consider marking this type as Copy
158
- --> $DIR/needless_pass_by_value.rs:122 :1
158
+ --> $DIR/needless_pass_by_value.rs:123 :1
159
159
|
160
160
LL | struct CopyWrapper(u32);
161
161
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -168,13 +168,13 @@ LL | let CopyWrapper(_) = *y; // still not moved
168
168
|
169
169
170
170
error: 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
172
172
|
173
173
LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
174
174
| ^^^^^^^^^^^
175
175
|
176
176
help: consider marking this type as Copy
177
- --> $DIR/needless_pass_by_value.rs:122 :1
177
+ --> $DIR/needless_pass_by_value.rs:123 :1
178
178
|
179
179
LL | struct CopyWrapper(u32);
180
180
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -185,13 +185,13 @@ LL | let CopyWrapper(s) = *z; // moved
185
185
|
186
186
187
187
error: 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
189
189
|
190
190
LL | fn some_fun<'b, S: Bar<'b, ()>>(_item: S) {}
191
191
| ^ help: consider taking a reference instead: `&S`
192
192
193
193
error: 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
195
195
|
196
196
LL | fn more_fun(_item: impl Club<'static, i32>) {}
197
197
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&impl Club<'static, i32>`
0 commit comments