fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
18.0 KiB521 linesraw
1error: redundant clone
2  --> $DIR/unnecessary_to_owned.rs:148:64
3   |
4LL |     require_c_str(&CString::from_vec_with_nul(vec![0]).unwrap().to_owned());
5   |                                                                ^^^^^^^^^^^ help: remove this
6   |
7note: this value is dropped without further use
8  --> $DIR/unnecessary_to_owned.rs:148:20
9   |
10LL |     require_c_str(&CString::from_vec_with_nul(vec![0]).unwrap().to_owned());
11   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12   = note: `-D clippy::redundant-clone` implied by `-D warnings`
13   = help: to override `-D warnings` add `#[allow(clippy::redundant_clone)]`
14
15error: redundant clone
16  --> $DIR/unnecessary_to_owned.rs:149:40
17   |
18LL |     require_os_str(&OsString::from("x").to_os_string());
19   |                                        ^^^^^^^^^^^^^^^ help: remove this
20   |
21note: this value is dropped without further use
22  --> $DIR/unnecessary_to_owned.rs:149:21
23   |
24LL |     require_os_str(&OsString::from("x").to_os_string());
25   |                     ^^^^^^^^^^^^^^^^^^^
26
27error: redundant clone
28  --> $DIR/unnecessary_to_owned.rs:150:48
29   |
30LL |     require_path(&std::path::PathBuf::from("x").to_path_buf());
31   |                                                ^^^^^^^^^^^^^^ help: remove this
32   |
33note: this value is dropped without further use
34  --> $DIR/unnecessary_to_owned.rs:150:19
35   |
36LL |     require_path(&std::path::PathBuf::from("x").to_path_buf());
37   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38
39error: redundant clone
40  --> $DIR/unnecessary_to_owned.rs:151:35
41   |
42LL |     require_str(&String::from("x").to_string());
43   |                                   ^^^^^^^^^^^^ help: remove this
44   |
45note: this value is dropped without further use
46  --> $DIR/unnecessary_to_owned.rs:151:18
47   |
48LL |     require_str(&String::from("x").to_string());
49   |                  ^^^^^^^^^^^^^^^^^
50
51error: redundant clone
52  --> $DIR/unnecessary_to_owned.rs:152:39
53   |
54LL |     require_slice(&[String::from("x")].to_owned());
55   |                                       ^^^^^^^^^^^ help: remove this
56   |
57note: this value is dropped without further use
58  --> $DIR/unnecessary_to_owned.rs:152:20
59   |
60LL |     require_slice(&[String::from("x")].to_owned());
61   |                    ^^^^^^^^^^^^^^^^^^^
62
63error: unnecessary use of `into_owned`
64  --> $DIR/unnecessary_to_owned.rs:57:36
65   |
66LL |     require_c_str(&Cow::from(c_str).into_owned());
67   |                                    ^^^^^^^^^^^^^ help: remove this
68   |
69   = note: `-D clippy::unnecessary-to-owned` implied by `-D warnings`
70   = help: to override `-D warnings` add `#[allow(clippy::unnecessary_to_owned)]`
71
72error: unnecessary use of `to_owned`
73  --> $DIR/unnecessary_to_owned.rs:58:19
74   |
75LL |     require_c_str(&c_str.to_owned());
76   |                   ^^^^^^^^^^^^^^^^^ help: use: `c_str`
77
78error: unnecessary use of `to_os_string`
79  --> $DIR/unnecessary_to_owned.rs:60:20
80   |
81LL |     require_os_str(&os_str.to_os_string());
82   |                    ^^^^^^^^^^^^^^^^^^^^^^ help: use: `os_str`
83
84error: unnecessary use of `into_owned`
85  --> $DIR/unnecessary_to_owned.rs:61:38
86   |
87LL |     require_os_str(&Cow::from(os_str).into_owned());
88   |                                      ^^^^^^^^^^^^^ help: remove this
89
90error: unnecessary use of `to_owned`
91  --> $DIR/unnecessary_to_owned.rs:62:20
92   |
93LL |     require_os_str(&os_str.to_owned());
94   |                    ^^^^^^^^^^^^^^^^^^ help: use: `os_str`
95
96error: unnecessary use of `to_path_buf`
97  --> $DIR/unnecessary_to_owned.rs:64:18
98   |
99LL |     require_path(&path.to_path_buf());
100   |                  ^^^^^^^^^^^^^^^^^^^ help: use: `path`
101
102error: unnecessary use of `into_owned`
103  --> $DIR/unnecessary_to_owned.rs:65:34
104   |
105LL |     require_path(&Cow::from(path).into_owned());
106   |                                  ^^^^^^^^^^^^^ help: remove this
107
108error: unnecessary use of `to_owned`
109  --> $DIR/unnecessary_to_owned.rs:66:18
110   |
111LL |     require_path(&path.to_owned());
112   |                  ^^^^^^^^^^^^^^^^ help: use: `path`
113
114error: unnecessary use of `to_string`
115  --> $DIR/unnecessary_to_owned.rs:68:17
116   |
117LL |     require_str(&s.to_string());
118   |                 ^^^^^^^^^^^^^^ help: use: `s`
119
120error: unnecessary use of `into_owned`
121  --> $DIR/unnecessary_to_owned.rs:69:30
122   |
123LL |     require_str(&Cow::from(s).into_owned());
124   |                              ^^^^^^^^^^^^^ help: remove this
125
126error: unnecessary use of `to_owned`
127  --> $DIR/unnecessary_to_owned.rs:70:17
128   |
129LL |     require_str(&s.to_owned());
130   |                 ^^^^^^^^^^^^^ help: use: `s`
131
132error: unnecessary use of `to_string`
133  --> $DIR/unnecessary_to_owned.rs:71:17
134   |
135LL |     require_str(&x_ref.to_string());
136   |                 ^^^^^^^^^^^^^^^^^^ help: use: `x_ref.as_ref()`
137
138error: unnecessary use of `to_vec`
139  --> $DIR/unnecessary_to_owned.rs:73:19
140   |
141LL |     require_slice(&slice.to_vec());
142   |                   ^^^^^^^^^^^^^^^ help: use: `slice`
143
144error: unnecessary use of `into_owned`
145  --> $DIR/unnecessary_to_owned.rs:74:36
146   |
147LL |     require_slice(&Cow::from(slice).into_owned());
148   |                                    ^^^^^^^^^^^^^ help: remove this
149
150error: unnecessary use of `to_owned`
151  --> $DIR/unnecessary_to_owned.rs:75:19
152   |
153LL |     require_slice(&array.to_owned());
154   |                   ^^^^^^^^^^^^^^^^^ help: use: `array.as_ref()`
155
156error: unnecessary use of `to_owned`
157  --> $DIR/unnecessary_to_owned.rs:76:19
158   |
159LL |     require_slice(&array_ref.to_owned());
160   |                   ^^^^^^^^^^^^^^^^^^^^^ help: use: `array_ref.as_ref()`
161
162error: unnecessary use of `to_owned`
163  --> $DIR/unnecessary_to_owned.rs:77:19
164   |
165LL |     require_slice(&slice.to_owned());
166   |                   ^^^^^^^^^^^^^^^^^ help: use: `slice`
167
168error: unnecessary use of `into_owned`
169  --> $DIR/unnecessary_to_owned.rs:80:42
170   |
171LL |     require_x(&Cow::<X>::Owned(x.clone()).into_owned());
172   |                                          ^^^^^^^^^^^^^ help: remove this
173
174error: unnecessary use of `to_owned`
175  --> $DIR/unnecessary_to_owned.rs:83:25
176   |
177LL |     require_deref_c_str(c_str.to_owned());
178   |                         ^^^^^^^^^^^^^^^^ help: use: `c_str`
179
180error: unnecessary use of `to_owned`
181  --> $DIR/unnecessary_to_owned.rs:84:26
182   |
183LL |     require_deref_os_str(os_str.to_owned());
184   |                          ^^^^^^^^^^^^^^^^^ help: use: `os_str`
185
186error: unnecessary use of `to_owned`
187  --> $DIR/unnecessary_to_owned.rs:85:24
188   |
189LL |     require_deref_path(path.to_owned());
190   |                        ^^^^^^^^^^^^^^^ help: use: `path`
191
192error: unnecessary use of `to_owned`
193  --> $DIR/unnecessary_to_owned.rs:86:23
194   |
195LL |     require_deref_str(s.to_owned());
196   |                       ^^^^^^^^^^^^ help: use: `s`
197
198error: unnecessary use of `to_owned`
199  --> $DIR/unnecessary_to_owned.rs:87:25
200   |
201LL |     require_deref_slice(slice.to_owned());
202   |                         ^^^^^^^^^^^^^^^^ help: use: `slice`
203
204error: unnecessary use of `to_owned`
205  --> $DIR/unnecessary_to_owned.rs:89:30
206   |
207LL |     require_impl_deref_c_str(c_str.to_owned());
208   |                              ^^^^^^^^^^^^^^^^ help: use: `c_str`
209
210error: unnecessary use of `to_owned`
211  --> $DIR/unnecessary_to_owned.rs:90:31
212   |
213LL |     require_impl_deref_os_str(os_str.to_owned());
214   |                               ^^^^^^^^^^^^^^^^^ help: use: `os_str`
215
216error: unnecessary use of `to_owned`
217  --> $DIR/unnecessary_to_owned.rs:91:29
218   |
219LL |     require_impl_deref_path(path.to_owned());
220   |                             ^^^^^^^^^^^^^^^ help: use: `path`
221
222error: unnecessary use of `to_owned`
223  --> $DIR/unnecessary_to_owned.rs:92:28
224   |
225LL |     require_impl_deref_str(s.to_owned());
226   |                            ^^^^^^^^^^^^ help: use: `s`
227
228error: unnecessary use of `to_owned`
229  --> $DIR/unnecessary_to_owned.rs:93:30
230   |
231LL |     require_impl_deref_slice(slice.to_owned());
232   |                              ^^^^^^^^^^^^^^^^ help: use: `slice`
233
234error: unnecessary use of `to_owned`
235  --> $DIR/unnecessary_to_owned.rs:95:29
236   |
237LL |     require_deref_str_slice(s.to_owned(), slice.to_owned());
238   |                             ^^^^^^^^^^^^ help: use: `s`
239
240error: unnecessary use of `to_owned`
241  --> $DIR/unnecessary_to_owned.rs:95:43
242   |
243LL |     require_deref_str_slice(s.to_owned(), slice.to_owned());
244   |                                           ^^^^^^^^^^^^^^^^ help: use: `slice`
245
246error: unnecessary use of `to_owned`
247  --> $DIR/unnecessary_to_owned.rs:96:29
248   |
249LL |     require_deref_slice_str(slice.to_owned(), s.to_owned());
250   |                             ^^^^^^^^^^^^^^^^ help: use: `slice`
251
252error: unnecessary use of `to_owned`
253  --> $DIR/unnecessary_to_owned.rs:96:47
254   |
255LL |     require_deref_slice_str(slice.to_owned(), s.to_owned());
256   |                                               ^^^^^^^^^^^^ help: use: `s`
257
258error: unnecessary use of `to_owned`
259  --> $DIR/unnecessary_to_owned.rs:98:26
260   |
261LL |     require_as_ref_c_str(c_str.to_owned());
262   |                          ^^^^^^^^^^^^^^^^ help: use: `c_str`
263
264error: unnecessary use of `to_owned`
265  --> $DIR/unnecessary_to_owned.rs:99:27
266   |
267LL |     require_as_ref_os_str(os_str.to_owned());
268   |                           ^^^^^^^^^^^^^^^^^ help: use: `os_str`
269
270error: unnecessary use of `to_owned`
271  --> $DIR/unnecessary_to_owned.rs:100:25
272   |
273LL |     require_as_ref_path(path.to_owned());
274   |                         ^^^^^^^^^^^^^^^ help: use: `path`
275
276error: unnecessary use of `to_owned`
277  --> $DIR/unnecessary_to_owned.rs:101:24
278   |
279LL |     require_as_ref_str(s.to_owned());
280   |                        ^^^^^^^^^^^^ help: use: `s`
281
282error: unnecessary use of `to_owned`
283  --> $DIR/unnecessary_to_owned.rs:102:24
284   |
285LL |     require_as_ref_str(x.to_owned());
286   |                        ^^^^^^^^^^^^ help: use: `&x`
287
288error: unnecessary use of `to_owned`
289  --> $DIR/unnecessary_to_owned.rs:103:26
290   |
291LL |     require_as_ref_slice(array.to_owned());
292   |                          ^^^^^^^^^^^^^^^^ help: use: `array`
293
294error: unnecessary use of `to_owned`
295  --> $DIR/unnecessary_to_owned.rs:104:26
296   |
297LL |     require_as_ref_slice(array_ref.to_owned());
298   |                          ^^^^^^^^^^^^^^^^^^^^ help: use: `array_ref`
299
300error: unnecessary use of `to_owned`
301  --> $DIR/unnecessary_to_owned.rs:105:26
302   |
303LL |     require_as_ref_slice(slice.to_owned());
304   |                          ^^^^^^^^^^^^^^^^ help: use: `slice`
305
306error: unnecessary use of `to_owned`
307  --> $DIR/unnecessary_to_owned.rs:107:31
308   |
309LL |     require_impl_as_ref_c_str(c_str.to_owned());
310   |                               ^^^^^^^^^^^^^^^^ help: use: `c_str`
311
312error: unnecessary use of `to_owned`
313  --> $DIR/unnecessary_to_owned.rs:108:32
314   |
315LL |     require_impl_as_ref_os_str(os_str.to_owned());
316   |                                ^^^^^^^^^^^^^^^^^ help: use: `os_str`
317
318error: unnecessary use of `to_owned`
319  --> $DIR/unnecessary_to_owned.rs:109:30
320   |
321LL |     require_impl_as_ref_path(path.to_owned());
322   |                              ^^^^^^^^^^^^^^^ help: use: `path`
323
324error: unnecessary use of `to_owned`
325  --> $DIR/unnecessary_to_owned.rs:110:29
326   |
327LL |     require_impl_as_ref_str(s.to_owned());
328   |                             ^^^^^^^^^^^^ help: use: `s`
329
330error: unnecessary use of `to_owned`
331  --> $DIR/unnecessary_to_owned.rs:111:29
332   |
333LL |     require_impl_as_ref_str(x.to_owned());
334   |                             ^^^^^^^^^^^^ help: use: `&x`
335
336error: unnecessary use of `to_owned`
337  --> $DIR/unnecessary_to_owned.rs:112:31
338   |
339LL |     require_impl_as_ref_slice(array.to_owned());
340   |                               ^^^^^^^^^^^^^^^^ help: use: `array`
341
342error: unnecessary use of `to_owned`
343  --> $DIR/unnecessary_to_owned.rs:113:31
344   |
345LL |     require_impl_as_ref_slice(array_ref.to_owned());
346   |                               ^^^^^^^^^^^^^^^^^^^^ help: use: `array_ref`
347
348error: unnecessary use of `to_owned`
349  --> $DIR/unnecessary_to_owned.rs:114:31
350   |
351LL |     require_impl_as_ref_slice(slice.to_owned());
352   |                               ^^^^^^^^^^^^^^^^ help: use: `slice`
353
354error: unnecessary use of `to_owned`
355  --> $DIR/unnecessary_to_owned.rs:116:30
356   |
357LL |     require_as_ref_str_slice(s.to_owned(), array.to_owned());
358   |                              ^^^^^^^^^^^^ help: use: `s`
359
360error: unnecessary use of `to_owned`
361  --> $DIR/unnecessary_to_owned.rs:116:44
362   |
363LL |     require_as_ref_str_slice(s.to_owned(), array.to_owned());
364   |                                            ^^^^^^^^^^^^^^^^ help: use: `array`
365
366error: unnecessary use of `to_owned`
367  --> $DIR/unnecessary_to_owned.rs:117:30
368   |
369LL |     require_as_ref_str_slice(s.to_owned(), array_ref.to_owned());
370   |                              ^^^^^^^^^^^^ help: use: `s`
371
372error: unnecessary use of `to_owned`
373  --> $DIR/unnecessary_to_owned.rs:117:44
374   |
375LL |     require_as_ref_str_slice(s.to_owned(), array_ref.to_owned());
376   |                                            ^^^^^^^^^^^^^^^^^^^^ help: use: `array_ref`
377
378error: unnecessary use of `to_owned`
379  --> $DIR/unnecessary_to_owned.rs:118:30
380   |
381LL |     require_as_ref_str_slice(s.to_owned(), slice.to_owned());
382   |                              ^^^^^^^^^^^^ help: use: `s`
383
384error: unnecessary use of `to_owned`
385  --> $DIR/unnecessary_to_owned.rs:118:44
386   |
387LL |     require_as_ref_str_slice(s.to_owned(), slice.to_owned());
388   |                                            ^^^^^^^^^^^^^^^^ help: use: `slice`
389
390error: unnecessary use of `to_owned`
391  --> $DIR/unnecessary_to_owned.rs:119:30
392   |
393LL |     require_as_ref_slice_str(array.to_owned(), s.to_owned());
394   |                              ^^^^^^^^^^^^^^^^ help: use: `array`
395
396error: unnecessary use of `to_owned`
397  --> $DIR/unnecessary_to_owned.rs:119:48
398   |
399LL |     require_as_ref_slice_str(array.to_owned(), s.to_owned());
400   |                                                ^^^^^^^^^^^^ help: use: `s`
401
402error: unnecessary use of `to_owned`
403  --> $DIR/unnecessary_to_owned.rs:120:30
404   |
405LL |     require_as_ref_slice_str(array_ref.to_owned(), s.to_owned());
406   |                              ^^^^^^^^^^^^^^^^^^^^ help: use: `array_ref`
407
408error: unnecessary use of `to_owned`
409  --> $DIR/unnecessary_to_owned.rs:120:52
410   |
411LL |     require_as_ref_slice_str(array_ref.to_owned(), s.to_owned());
412   |                                                    ^^^^^^^^^^^^ help: use: `s`
413
414error: unnecessary use of `to_owned`
415  --> $DIR/unnecessary_to_owned.rs:121:30
416   |
417LL |     require_as_ref_slice_str(slice.to_owned(), s.to_owned());
418   |                              ^^^^^^^^^^^^^^^^ help: use: `slice`
419
420error: unnecessary use of `to_owned`
421  --> $DIR/unnecessary_to_owned.rs:121:48
422   |
423LL |     require_as_ref_slice_str(slice.to_owned(), s.to_owned());
424   |                                                ^^^^^^^^^^^^ help: use: `s`
425
426error: unnecessary use of `to_string`
427  --> $DIR/unnecessary_to_owned.rs:123:20
428   |
429LL |     let _ = x.join(&x_ref.to_string());
430   |                    ^^^^^^^^^^^^^^^^^^ help: use: `x_ref`
431
432error: unnecessary use of `to_vec`
433  --> $DIR/unnecessary_to_owned.rs:125:13
434   |
435LL |     let _ = slice.to_vec().into_iter();
436   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `slice.iter().copied()`
437
438error: unnecessary use of `to_owned`
439  --> $DIR/unnecessary_to_owned.rs:126:13
440   |
441LL |     let _ = slice.to_owned().into_iter();
442   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `slice.iter().copied()`
443
444error: unnecessary use of `to_vec`
445  --> $DIR/unnecessary_to_owned.rs:127:13
446   |
447LL |     let _ = [std::path::PathBuf::new()][..].to_vec().into_iter();
448   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
449
450error: unnecessary use of `to_owned`
451  --> $DIR/unnecessary_to_owned.rs:128:13
452   |
453LL |     let _ = [std::path::PathBuf::new()][..].to_owned().into_iter();
454   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
455
456error: unnecessary use of `to_vec`
457  --> $DIR/unnecessary_to_owned.rs:130:13
458   |
459LL |     let _ = IntoIterator::into_iter(slice.to_vec());
460   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `slice.iter().copied()`
461
462error: unnecessary use of `to_owned`
463  --> $DIR/unnecessary_to_owned.rs:131:13
464   |
465LL |     let _ = IntoIterator::into_iter(slice.to_owned());
466   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `slice.iter().copied()`
467
468error: unnecessary use of `to_vec`
469  --> $DIR/unnecessary_to_owned.rs:132:13
470   |
471LL |     let _ = IntoIterator::into_iter([std::path::PathBuf::new()][..].to_vec());
472   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
473
474error: unnecessary use of `to_owned`
475  --> $DIR/unnecessary_to_owned.rs:133:13
476   |
477LL |     let _ = IntoIterator::into_iter([std::path::PathBuf::new()][..].to_owned());
478   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
479
480error: unnecessary use of `to_vec`
481  --> $DIR/unnecessary_to_owned.rs:195:14
482   |
483LL |     for t in file_types.to_vec() {
484   |              ^^^^^^^^^^^^^^^^^^^
485   |
486help: use
487   |
488LL |     for t in file_types {
489   |              ~~~~~~~~~~
490help: remove this `&`
491   |
492LL -         let path = match get_file_path(&t) {
493LL +         let path = match get_file_path(t) {
494   |
495
496error: unnecessary use of `to_vec`
497  --> $DIR/unnecessary_to_owned.rs:218:14
498   |
499LL |     let _ = &["x"][..].to_vec().into_iter();
500   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `["x"][..].iter().cloned()`
501
502error: unnecessary use of `to_vec`
503  --> $DIR/unnecessary_to_owned.rs:223:14
504   |
505LL |     let _ = &["x"][..].to_vec().into_iter();
506   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `["x"][..].iter().copied()`
507
508error: unnecessary use of `to_string`
509  --> $DIR/unnecessary_to_owned.rs:270:24
510   |
511LL |         Box::new(build(y.to_string()))
512   |                        ^^^^^^^^^^^^^ help: use: `y`
513
514error: unnecessary use of `to_string`
515  --> $DIR/unnecessary_to_owned.rs:378:12
516   |
517LL |         id("abc".to_string())
518   |            ^^^^^^^^^^^^^^^^^ help: use: `"abc"`
519
520error: aborting due to 79 previous errors
521