1
1
error: 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
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:31 :11
10
+ --> $DIR/needless_pass_by_value.rs:32 :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:31 :22
16
+ --> $DIR/needless_pass_by_value.rs:32 :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:37 :71
22
+ --> $DIR/needless_pass_by_value.rs:38 :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:49 :18
28
+ --> $DIR/needless_pass_by_value.rs:50 :18
29
29
|
30
30
LL | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
31
31
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&Option<Option<String>>`
32
32
33
33
error: 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
35
35
|
36
36
LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
37
37
| ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
38
38
39
39
error: 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
41
41
|
42
42
LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
43
43
| ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
44
44
45
45
error: 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
47
47
|
48
48
LL | fn test_blanket_ref<T: Foo, S: Serialize>(_foo: T, _serializable: S) {}
49
49
| ^ help: consider taking a reference instead: `&T`
50
50
51
51
error: 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
53
53
|
54
54
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
55
55
| ^^^^^^ help: consider taking a reference instead: `&String`
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:80 :29
58
+ --> $DIR/needless_pass_by_value.rs:81 :29
59
59
|
60
60
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
61
61
| ^^^^^^
@@ -70,13 +70,13 @@ LL | let _ = t.to_string();
70
70
| ^^^^^^^^^^^^^
71
71
72
72
error: 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
74
74
|
75
75
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
76
76
| ^^^^^^^^ help: consider taking a reference instead: `&Vec<i32>`
77
77
78
78
error: 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
80
80
|
81
81
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
82
82
| ^^^^^^^^
@@ -91,85 +91,85 @@ LL | let _ = v.to_owned();
91
91
| ^^^^^^^^^^^^
92
92
93
93
error: 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
95
95
|
96
96
LL | s: String,
97
97
| ^^^^^^ help: consider changing the type to: `&str`
98
98
99
99
error: 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
101
101
|
102
102
LL | t: String,
103
103
| ^^^^^^ help: consider taking a reference instead: `&String`
104
104
105
105
error: 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
107
107
|
108
108
LL | fn baz(&self, _u: U, _s: Self) {}
109
109
| ^ help: consider taking a reference instead: `&U`
110
110
111
111
error: 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
113
113
|
114
114
LL | fn baz(&self, _u: U, _s: Self) {}
115
115
| ^^^^ help: consider taking a reference instead: `&Self`
116
116
117
117
error: 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
119
119
|
120
120
LL | fn bar_copy(x: u32, y: CopyWrapper) {
121
121
| ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
122
122
|
123
123
help: consider marking this type as Copy
124
- --> $DIR/needless_pass_by_value.rs:123 :1
124
+ --> $DIR/needless_pass_by_value.rs:124 :1
125
125
|
126
126
LL | struct CopyWrapper(u32);
127
127
| ^^^^^^^^^^^^^^^^^^^^^^^^
128
128
129
129
error: 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
131
131
|
132
132
LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
133
133
| ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
134
134
|
135
135
help: consider marking this type as Copy
136
- --> $DIR/needless_pass_by_value.rs:123 :1
136
+ --> $DIR/needless_pass_by_value.rs:124 :1
137
137
|
138
138
LL | struct CopyWrapper(u32);
139
139
| ^^^^^^^^^^^^^^^^^^^^^^^^
140
140
141
141
error: 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
143
143
|
144
144
LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
145
145
| ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
146
146
|
147
147
help: consider marking this type as Copy
148
- --> $DIR/needless_pass_by_value.rs:123 :1
148
+ --> $DIR/needless_pass_by_value.rs:124 :1
149
149
|
150
150
LL | struct CopyWrapper(u32);
151
151
| ^^^^^^^^^^^^^^^^^^^^^^^^
152
152
153
153
error: 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
155
155
|
156
156
LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
157
157
| ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
158
158
|
159
159
help: consider marking this type as Copy
160
- --> $DIR/needless_pass_by_value.rs:123 :1
160
+ --> $DIR/needless_pass_by_value.rs:124 :1
161
161
|
162
162
LL | struct CopyWrapper(u32);
163
163
| ^^^^^^^^^^^^^^^^^^^^^^^^
164
164
165
165
error: 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
167
167
|
168
168
LL | fn some_fun<'b, S: Bar<'b, ()>>(_item: S) {}
169
169
| ^ help: consider taking a reference instead: `&S`
170
170
171
171
error: 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
173
173
|
174
174
LL | fn more_fun(_item: impl Club<'static, i32>) {}
175
175
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&impl Club<'static, i32>`
0 commit comments