@@ -17,43 +17,78 @@ error: this argument is passed by value, but not consumed in the function body
1717 --> tests/ui/needless_pass_by_value.rs:35:22
1818 |
1919LL | fn bar(x: String, y: Wrapper) {
20- | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
20+ | ^^^^^^^
21+ |
22+ help: consider taking a reference instead
23+ |
24+ LL | fn bar(x: String, y: &Wrapper) {
25+ | +
2126
2227error: this argument is passed by value, but not consumed in the function body
2328 --> tests/ui/needless_pass_by_value.rs:44:71
2429 |
2530LL | fn test_borrow_trait<T: Borrow<str>, U: AsRef<str>, V>(t: T, u: U, v: V) {
26- | ^ help: consider taking a reference instead: `&V`
31+ | ^
32+ |
33+ help: consider taking a reference instead
34+ |
35+ LL | fn test_borrow_trait<T: Borrow<str>, U: AsRef<str>, V>(t: T, u: U, v: &V) {
36+ | +
2737
2838error: this argument is passed by value, but not consumed in the function body
2939 --> tests/ui/needless_pass_by_value.rs:58:18
3040 |
3141LL | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
32- | ^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `Option<Option<&String>>`
42+ | ^^^^^^^^^^^^^^^^^^^^^^
43+ |
44+ help: consider taking a reference instead
45+ |
46+ LL | fn test_match(x: Option<Option<&String>>, y: Option<Option<String>>) {
47+ | +
3348
3449error: this argument is passed by value, but not consumed in the function body
3550 --> tests/ui/needless_pass_by_value.rs:73:24
3651 |
3752LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
38- | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
53+ | ^^^^^^^
54+ |
55+ help: consider taking a reference instead
56+ |
57+ LL | fn test_destructure(x: &Wrapper, y: Wrapper, z: Wrapper) {
58+ | +
3959
4060error: this argument is passed by value, but not consumed in the function body
4161 --> tests/ui/needless_pass_by_value.rs:73:36
4262 |
4363LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
44- | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
64+ | ^^^^^^^
65+ |
66+ help: consider taking a reference instead
67+ |
68+ LL | fn test_destructure(x: Wrapper, y: &Wrapper, z: Wrapper) {
69+ | +
4570
4671error: this argument is passed by value, but not consumed in the function body
4772 --> tests/ui/needless_pass_by_value.rs:92:49
4873 |
4974LL | fn test_blanket_ref<T: Foo, S: Serialize>(vals: T, serializable: S) {}
50- | ^ help: consider taking a reference instead: `&T`
75+ | ^
76+ |
77+ help: consider taking a reference instead
78+ |
79+ LL | fn test_blanket_ref<T: Foo, S: Serialize>(vals: &T, serializable: S) {}
80+ | +
5181
5282error: this argument is passed by value, but not consumed in the function body
5383 --> tests/ui/needless_pass_by_value.rs:95:18
5484 |
5585LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
56- | ^^^^^^ help: consider taking a reference instead: `&String`
86+ | ^^^^^^
87+ |
88+ help: consider taking a reference instead
89+ |
90+ LL | fn issue_2114(s: &String, t: String, u: Vec<i32>, v: Vec<i32>) {
91+ | +
5792
5893error: this argument is passed by value, but not consumed in the function body
5994 --> tests/ui/needless_pass_by_value.rs:95:29
@@ -76,7 +111,12 @@ error: this argument is passed by value, but not consumed in the function body
76111 --> tests/ui/needless_pass_by_value.rs:95:40
77112 |
78113LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
79- | ^^^^^^^^ help: consider taking a reference instead: `&Vec<i32>`
114+ | ^^^^^^^^
115+ |
116+ help: consider taking a reference instead
117+ |
118+ LL | fn issue_2114(s: String, t: String, u: &Vec<i32>, v: Vec<i32>) {
119+ | +
80120
81121error: this argument is passed by value, but not consumed in the function body
82122 --> tests/ui/needless_pass_by_value.rs:95:53
@@ -105,109 +145,175 @@ error: this argument is passed by value, but not consumed in the function body
105145 --> tests/ui/needless_pass_by_value.rs:115:12
106146 |
107147LL | t: String,
108- | ^^^^^^ help: consider taking a reference instead: `&String`
148+ | ^^^^^^
149+ |
150+ help: consider taking a reference instead
151+ |
152+ LL | t: &String,
153+ | +
109154
110155error: this argument is passed by value, but not consumed in the function body
111156 --> tests/ui/needless_pass_by_value.rs:125:23
112157 |
113158LL | fn baz(&self, uu: U, ss: Self) {}
114- | ^ help: consider taking a reference instead: `&U`
159+ | ^
160+ |
161+ help: consider taking a reference instead
162+ |
163+ LL | fn baz(&self, uu: &U, ss: Self) {}
164+ | +
115165
116166error: this argument is passed by value, but not consumed in the function body
117167 --> tests/ui/needless_pass_by_value.rs:125:30
118168 |
119169LL | fn baz(&self, uu: U, ss: Self) {}
120- | ^^^^ help: consider taking a reference instead: `&Self`
170+ | ^^^^
171+ |
172+ help: consider taking a reference instead
173+ |
174+ LL | fn baz(&self, uu: U, ss: &Self) {}
175+ | +
121176
122177error: this argument is passed by value, but not consumed in the function body
123178 --> tests/ui/needless_pass_by_value.rs:149:24
124179 |
125180LL | fn bar_copy(x: u32, y: CopyWrapper) {
126- | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
181+ | ^^^^^^^^^^^
127182 |
128183help: or consider marking this type as `Copy`
129184 --> tests/ui/needless_pass_by_value.rs:147:1
130185 |
131186LL | struct CopyWrapper(u32);
132187 | ^^^^^^^^^^^^^^^^^^
188+ help: consider taking a reference instead
189+ |
190+ LL | fn bar_copy(x: u32, y: &CopyWrapper) {
191+ | +
133192
134193error: this argument is passed by value, but not consumed in the function body
135194 --> tests/ui/needless_pass_by_value.rs:157:29
136195 |
137196LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
138- | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
197+ | ^^^^^^^^^^^
139198 |
140199help: or consider marking this type as `Copy`
141200 --> tests/ui/needless_pass_by_value.rs:147:1
142201 |
143202LL | struct CopyWrapper(u32);
144203 | ^^^^^^^^^^^^^^^^^^
204+ help: consider taking a reference instead
205+ |
206+ LL | fn test_destructure_copy(x: &CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
207+ | +
145208
146209error: this argument is passed by value, but not consumed in the function body
147210 --> tests/ui/needless_pass_by_value.rs:157:45
148211 |
149212LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
150- | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
213+ | ^^^^^^^^^^^
151214 |
152215help: or consider marking this type as `Copy`
153216 --> tests/ui/needless_pass_by_value.rs:147:1
154217 |
155218LL | struct CopyWrapper(u32);
156219 | ^^^^^^^^^^^^^^^^^^
220+ help: consider taking a reference instead
221+ |
222+ LL | fn test_destructure_copy(x: CopyWrapper, y: &CopyWrapper, z: CopyWrapper) {
223+ | +
157224
158225error: this argument is passed by value, but not consumed in the function body
159226 --> tests/ui/needless_pass_by_value.rs:157:61
160227 |
161228LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
162- | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
229+ | ^^^^^^^^^^^
163230 |
164231help: or consider marking this type as `Copy`
165232 --> tests/ui/needless_pass_by_value.rs:147:1
166233 |
167234LL | struct CopyWrapper(u32);
168235 | ^^^^^^^^^^^^^^^^^^
236+ help: consider taking a reference instead
237+ |
238+ LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: &CopyWrapper) {
239+ | +
169240
170241error: this argument is passed by value, but not consumed in the function body
171242 --> tests/ui/needless_pass_by_value.rs:173:40
172243 |
173244LL | fn some_fun<'b, S: Bar<'b, ()>>(items: S) {}
174- | ^ help: consider taking a reference instead: `&S`
245+ | ^
246+ |
247+ help: consider taking a reference instead
248+ |
249+ LL | fn some_fun<'b, S: Bar<'b, ()>>(items: &S) {}
250+ | +
175251
176252error: this argument is passed by value, but not consumed in the function body
177253 --> tests/ui/needless_pass_by_value.rs:179:20
178254 |
179255LL | fn more_fun(items: impl Club<'static, i32>) {}
180- | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&impl Club<'static, i32>`
256+ | ^^^^^^^^^^^^^^^^^^^^^^^
257+ |
258+ help: consider taking a reference instead
259+ |
260+ LL | fn more_fun(items: &impl Club<'static, i32>) {}
261+ | +
181262
182263error: this argument is passed by value, but not consumed in the function body
183264 --> tests/ui/needless_pass_by_value.rs:194:24
184265 |
185266LL | fn option_inner_ref(x: Option<String>) {
186- | ^^^^^^^^^^^^^^ help: consider taking a reference instead: `Option<&String>`
267+ | ^^^^^^^^^^^^^^
268+ |
269+ help: consider taking a reference instead
270+ |
271+ LL | fn option_inner_ref(x: Option<&String>) {
272+ | +
187273
188274error: this argument is passed by value, but not consumed in the function body
189275 --> tests/ui/needless_pass_by_value.rs:204:27
190276 |
191277LL | fn non_standard_option(x: non_standard::Option<String>) {
192- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&non_standard::Option<String>`
278+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
279+ |
280+ help: consider taking a reference instead
281+ |
282+ LL | fn non_standard_option(x: &non_standard::Option<String>) {
283+ | +
193284
194285error: this argument is passed by value, but not consumed in the function body
195286 --> tests/ui/needless_pass_by_value.rs:209:22
196287 |
197288LL | fn option_by_name(x: Option<std::option::Option<core::option::Option<non_standard::Option<String>>>>) {
198- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `Option<std::option::Option<core::option::Option<&non_standard::Option<String>>>>`
289+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
290+ |
291+ help: consider taking a reference instead
292+ |
293+ LL | fn option_by_name(x: Option<std::option::Option<core::option::Option<&non_standard::Option<String>>>>) {
294+ | +
199295
200296error: this argument is passed by value, but not consumed in the function body
201297 --> tests/ui/needless_pass_by_value.rs:216:18
202298 |
203299LL | fn non_option(x: OptStr) {
204- | ^^^^^^ help: consider taking a reference instead: `&OptStr`
300+ | ^^^^^^
301+ |
302+ help: consider taking a reference instead
303+ |
304+ LL | fn non_option(x: &OptStr) {
305+ | +
205306
206307error: this argument is passed by value, but not consumed in the function body
207308 --> tests/ui/needless_pass_by_value.rs:223:25
208309 |
209310LL | fn non_option_either(x: Opt<String>) {
210- | ^^^^^^^^^^^ help: consider taking a reference instead: `&Opt<String>`
311+ | ^^^^^^^^^^^
312+ |
313+ help: consider taking a reference instead
314+ |
315+ LL | fn non_option_either(x: &Opt<String>) {
316+ | +
211317
212318error: aborting due to 27 previous errors
213319
0 commit comments