]> git.lizzy.rs Git - rust.git/blob - tests/ui/methods.stderr
move starts_ends_with tests
[rust.git] / tests / ui / methods.stderr
1 error: unnecessary structure name repetition
2   --> $DIR/methods.rs:20:25
3    |
4 20 |     fn add(self, other: T) -> T { self }
5    |                         ^ help: use the applicable keyword: `Self`
6    |
7    = note: `-D use-self` implied by `-D warnings`
8
9 error: unnecessary structure name repetition
10   --> $DIR/methods.rs:20:31
11    |
12 20 |     fn add(self, other: T) -> T { self }
13    |                               ^ help: use the applicable keyword: `Self`
14
15 error: unnecessary structure name repetition
16   --> $DIR/methods.rs:23:26
17    |
18 23 |     fn sub(&self, other: T) -> &T { self } // no error, self is a ref
19    |                          ^ help: use the applicable keyword: `Self`
20
21 error: unnecessary structure name repetition
22   --> $DIR/methods.rs:23:33
23    |
24 23 |     fn sub(&self, other: T) -> &T { self } // no error, self is a ref
25    |                                 ^ help: use the applicable keyword: `Self`
26
27 error: unnecessary structure name repetition
28   --> $DIR/methods.rs:24:21
29    |
30 24 |     fn div(self) -> T { self } // no error, different #arguments
31    |                     ^ help: use the applicable keyword: `Self`
32
33 error: unnecessary structure name repetition
34   --> $DIR/methods.rs:25:25
35    |
36 25 |     fn rem(self, other: T) { } // no error, wrong return type
37    |                         ^ help: use the applicable keyword: `Self`
38
39 error: defining a method called `add` on this type; consider implementing the `std::ops::Add` trait or choosing a less ambiguous name
40   --> $DIR/methods.rs:20:5
41    |
42 20 |     fn add(self, other: T) -> T { self }
43    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44    |
45    = note: `-D should-implement-trait` implied by `-D warnings`
46
47 error: defining a method called `drop` on this type; consider implementing the `std::ops::Drop` trait or choosing a less ambiguous name
48   --> $DIR/methods.rs:21:5
49    |
50 21 |     fn drop(&mut self) { }
51    |     ^^^^^^^^^^^^^^^^^^^^^^
52
53 error: methods called `into_*` usually take self by value; consider choosing a less ambiguous name
54   --> $DIR/methods.rs:28:17
55    |
56 28 |     fn into_u16(&self) -> u16 { 0 }
57    |                 ^^^^^
58    |
59    = note: `-D wrong-self-convention` implied by `-D warnings`
60
61 error: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name
62   --> $DIR/methods.rs:30:21
63    |
64 30 |     fn to_something(self) -> u32 { 0 }
65    |                     ^^^^
66
67 error: methods called `new` usually take no self; consider choosing a less ambiguous name
68   --> $DIR/methods.rs:32:12
69    |
70 32 |     fn new(self) {}
71    |            ^^^^
72
73 error: methods called `new` usually return `Self`
74   --> $DIR/methods.rs:32:5
75    |
76 32 |     fn new(self) {}
77    |     ^^^^^^^^^^^^^^^
78    |
79    = note: `-D new-ret-no-self` implied by `-D warnings`
80
81 error: unnecessary structure name repetition
82   --> $DIR/methods.rs:76:24
83    |
84 76 |     fn new() -> Option<V<T>> { None }
85    |                        ^^^^ help: use the applicable keyword: `Self`
86
87 error: unnecessary structure name repetition
88   --> $DIR/methods.rs:80:19
89    |
90 80 |     type Output = T;
91    |                   ^ help: use the applicable keyword: `Self`
92
93 error: unnecessary structure name repetition
94   --> $DIR/methods.rs:81:25
95    |
96 81 |     fn mul(self, other: T) -> T { self } // no error, obviously
97    |                         ^ help: use the applicable keyword: `Self`
98
99 error: unnecessary structure name repetition
100   --> $DIR/methods.rs:81:31
101    |
102 81 |     fn mul(self, other: T) -> T { self } // no error, obviously
103    |                               ^ help: use the applicable keyword: `Self`
104
105 error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
106    --> $DIR/methods.rs:99:13
107     |
108 99  |       let _ = opt.map(|x| x + 1)
109     |  _____________^
110 100 | |
111 101 | |                .unwrap_or(0); // should lint even though this call is on a separate line
112     | |____________________________^
113     |
114     = note: `-D option-map-unwrap-or` implied by `-D warnings`
115     = note: replace `map(|x| x + 1).unwrap_or(0)` with `map_or(0, |x| x + 1)`
116
117 error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
118    --> $DIR/methods.rs:103:13
119     |
120 103 |       let _ = opt.map(|x| {
121     |  _____________^
122 104 | |                         x + 1
123 105 | |                     }
124 106 | |               ).unwrap_or(0);
125     | |____________________________^
126
127 error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
128    --> $DIR/methods.rs:107:13
129     |
130 107 |       let _ = opt.map(|x| x + 1)
131     |  _____________^
132 108 | |                .unwrap_or({
133 109 | |                     0
134 110 | |                 });
135     | |__________________^
136
137 error: called `map(f).unwrap_or(None)` on an Option value. This can be done more directly by calling `and_then(f)` instead
138    --> $DIR/methods.rs:112:13
139     |
140 112 |     let _ = opt.map(|x| Some(x + 1)).unwrap_or(None);
141     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142     |
143     = note: replace `map(|x| Some(x + 1)).unwrap_or(None)` with `and_then(|x| Some(x + 1))`
144
145 error: called `map(f).unwrap_or(None)` on an Option value. This can be done more directly by calling `and_then(f)` instead
146    --> $DIR/methods.rs:114:13
147     |
148 114 |       let _ = opt.map(|x| {
149     |  _____________^
150 115 | |         Some(x + 1)
151 116 | |     }
152 117 | |     ).unwrap_or(None);
153     | |_____________________^
154
155 error: called `map(f).unwrap_or(None)` on an Option value. This can be done more directly by calling `and_then(f)` instead
156    --> $DIR/methods.rs:118:13
157     |
158 118 |       let _ = opt
159     |  _____________^
160 119 | |         .map(|x| Some(x + 1))
161 120 | |         .unwrap_or(None);
162     | |________________________^
163     |
164     = note: replace `map(|x| Some(x + 1)).unwrap_or(None)` with `and_then(|x| Some(x + 1))`
165
166 error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done more directly by calling `map_or_else(g, f)` instead
167    --> $DIR/methods.rs:126:13
168     |
169 126 |       let _ = opt.map(|x| x + 1)
170     |  _____________^
171 127 | |
172 128 | |                .unwrap_or_else(|| 0); // should lint even though this call is on a separate line
173     | |____________________________________^
174     |
175     = note: `-D option-map-unwrap-or-else` implied by `-D warnings`
176     = note: replace `map(|x| x + 1).unwrap_or_else(|| 0)` with `map_or_else(|| 0, |x| x + 1)`
177
178 error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done more directly by calling `map_or_else(g, f)` instead
179    --> $DIR/methods.rs:130:13
180     |
181 130 |       let _ = opt.map(|x| {
182     |  _____________^
183 131 | |                         x + 1
184 132 | |                     }
185 133 | |               ).unwrap_or_else(|| 0);
186     | |____________________________________^
187
188 error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done more directly by calling `map_or_else(g, f)` instead
189    --> $DIR/methods.rs:134:13
190     |
191 134 |       let _ = opt.map(|x| x + 1)
192     |  _____________^
193 135 | |                .unwrap_or_else(||
194 136 | |                     0
195 137 | |                 );
196     | |_________________^
197
198 error: unnecessary structure name repetition
199    --> $DIR/methods.rs:163:24
200     |
201 163 |     fn filter(self) -> IteratorFalsePositives {
202     |                        ^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
203
204 error: unnecessary structure name repetition
205    --> $DIR/methods.rs:167:22
206     |
207 167 |     fn next(self) -> IteratorFalsePositives {
208     |                      ^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
209
210 error: unnecessary structure name repetition
211    --> $DIR/methods.rs:187:32
212     |
213 187 |     fn skip(self, _: usize) -> IteratorFalsePositives {
214     |                                ^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
215
216 error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
217    --> $DIR/methods.rs:206:13
218     |
219 206 |     let _ = v.iter().filter(|&x| *x < 0).next();
220     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
221     |
222     = note: `-D filter-next` implied by `-D warnings`
223     = note: replace `filter(|&x| *x < 0).next()` with `find(|&x| *x < 0)`
224
225 error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
226    --> $DIR/methods.rs:209:13
227     |
228 209 |       let _ = v.iter().filter(|&x| {
229     |  _____________^
230 210 | |                                 *x < 0
231 211 | |                             }
232 212 | |                    ).next();
233     | |___________________________^
234
235 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
236    --> $DIR/methods.rs:224:13
237     |
238 224 |     let _ = v.iter().find(|&x| *x < 0).is_some();
239     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
240     |
241     = note: `-D search-is-some` implied by `-D warnings`
242     = note: replace `find(|&x| *x < 0).is_some()` with `any(|&x| *x < 0)`
243
244 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
245    --> $DIR/methods.rs:227:13
246     |
247 227 |       let _ = v.iter().find(|&x| {
248     |  _____________^
249 228 | |                               *x < 0
250 229 | |                           }
251 230 | |                    ).is_some();
252     | |______________________________^
253
254 error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
255    --> $DIR/methods.rs:233:13
256     |
257 233 |     let _ = v.iter().position(|&x| x < 0).is_some();
258     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
259     |
260     = note: replace `position(|&x| x < 0).is_some()` with `any(|&x| x < 0)`
261
262 error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
263    --> $DIR/methods.rs:236:13
264     |
265 236 |       let _ = v.iter().position(|&x| {
266     |  _____________^
267 237 | |                                   x < 0
268 238 | |                               }
269 239 | |                    ).is_some();
270     | |______________________________^
271
272 error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
273    --> $DIR/methods.rs:242:13
274     |
275 242 |     let _ = v.iter().rposition(|&x| x < 0).is_some();
276     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
277     |
278     = note: replace `rposition(|&x| x < 0).is_some()` with `any(|&x| x < 0)`
279
280 error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
281    --> $DIR/methods.rs:245:13
282     |
283 245 |       let _ = v.iter().rposition(|&x| {
284     |  _____________^
285 246 | |                                    x < 0
286 247 | |                                }
287 248 | |                    ).is_some();
288     | |______________________________^
289
290 error: unnecessary structure name repetition
291    --> $DIR/methods.rs:262:21
292     |
293 262 |         fn new() -> Foo { Foo }
294     |                     ^^^ help: use the applicable keyword: `Self`
295
296 error: use of `unwrap_or` followed by a function call
297    --> $DIR/methods.rs:280:5
298     |
299 280 |     with_constructor.unwrap_or(make());
300     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_constructor.unwrap_or_else(make)`
301     |
302     = note: `-D or-fun-call` implied by `-D warnings`
303
304 error: use of `unwrap_or` followed by a call to `new`
305    --> $DIR/methods.rs:283:5
306     |
307 283 |     with_new.unwrap_or(Vec::new());
308     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_new.unwrap_or_default()`
309
310 error: use of `unwrap_or` followed by a function call
311    --> $DIR/methods.rs:286:5
312     |
313 286 |     with_const_args.unwrap_or(Vec::with_capacity(12));
314     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_const_args.unwrap_or_else(|| Vec::with_capacity(12))`
315
316 error: use of `unwrap_or` followed by a function call
317    --> $DIR/methods.rs:289:5
318     |
319 289 |     with_err.unwrap_or(make());
320     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_err.unwrap_or_else(|_| make())`
321
322 error: use of `unwrap_or` followed by a function call
323    --> $DIR/methods.rs:292:5
324     |
325 292 |     with_err_args.unwrap_or(Vec::with_capacity(12));
326     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_err_args.unwrap_or_else(|_| Vec::with_capacity(12))`
327
328 error: use of `unwrap_or` followed by a call to `default`
329    --> $DIR/methods.rs:295:5
330     |
331 295 |     with_default_trait.unwrap_or(Default::default());
332     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_trait.unwrap_or_default()`
333
334 error: use of `unwrap_or` followed by a call to `default`
335    --> $DIR/methods.rs:298:5
336     |
337 298 |     with_default_type.unwrap_or(u64::default());
338     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_type.unwrap_or_default()`
339
340 error: use of `unwrap_or` followed by a function call
341    --> $DIR/methods.rs:301:5
342     |
343 301 |     with_vec.unwrap_or(vec![]);
344     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_vec.unwrap_or_else(|| < [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ))`
345
346 error: use of `unwrap_or` followed by a function call
347    --> $DIR/methods.rs:306:5
348     |
349 306 |     without_default.unwrap_or(Foo::new());
350     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `without_default.unwrap_or_else(Foo::new)`
351
352 error: use of `or_insert` followed by a function call
353    --> $DIR/methods.rs:309:5
354     |
355 309 |     map.entry(42).or_insert(String::new());
356     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `map.entry(42).or_insert_with(String::new)`
357
358 error: use of `or_insert` followed by a function call
359    --> $DIR/methods.rs:312:5
360     |
361 312 |     btree.entry(42).or_insert(String::new());
362     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `btree.entry(42).or_insert_with(String::new)`
363
364 error: use of `unwrap_or` followed by a function call
365    --> $DIR/methods.rs:315:13
366     |
367 315 |     let _ = stringy.unwrap_or("".to_owned());
368     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `stringy.unwrap_or_else(|| "".to_owned())`
369
370 error: called `.iter().nth()` on a Vec. Calling `.get()` is both faster and more readable
371    --> $DIR/methods.rs:326:23
372     |
373 326 |         let bad_vec = some_vec.iter().nth(3);
374     |                       ^^^^^^^^^^^^^^^^^^^^^^
375     |
376     = note: `-D iter-nth` implied by `-D warnings`
377
378 error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
379    --> $DIR/methods.rs:327:26
380     |
381 327 |         let bad_slice = &some_vec[..].iter().nth(3);
382     |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
383
384 error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
385    --> $DIR/methods.rs:328:31
386     |
387 328 |         let bad_boxed_slice = boxed_slice.iter().nth(3);
388     |                               ^^^^^^^^^^^^^^^^^^^^^^^^^
389
390 error: called `.iter().nth()` on a VecDeque. Calling `.get()` is both faster and more readable
391    --> $DIR/methods.rs:329:29
392     |
393 329 |         let bad_vec_deque = some_vec_deque.iter().nth(3);
394     |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
395
396 error: called `.iter_mut().nth()` on a Vec. Calling `.get_mut()` is both faster and more readable
397    --> $DIR/methods.rs:334:23
398     |
399 334 |         let bad_vec = some_vec.iter_mut().nth(3);
400     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
401
402 error: called `.iter_mut().nth()` on a slice. Calling `.get_mut()` is both faster and more readable
403    --> $DIR/methods.rs:337:26
404     |
405 337 |         let bad_slice = &some_vec[..].iter_mut().nth(3);
406     |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
407
408 error: called `.iter_mut().nth()` on a VecDeque. Calling `.get_mut()` is both faster and more readable
409    --> $DIR/methods.rs:340:29
410     |
411 340 |         let bad_vec_deque = some_vec_deque.iter_mut().nth(3);
412     |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
413
414 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
415    --> $DIR/methods.rs:352:13
416     |
417 352 |     let _ = some_vec.iter().skip(42).next();
418     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
419     |
420     = note: `-D iter-skip-next` implied by `-D warnings`
421
422 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
423    --> $DIR/methods.rs:353:13
424     |
425 353 |     let _ = some_vec.iter().cycle().skip(42).next();
426     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
427
428 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
429    --> $DIR/methods.rs:354:13
430     |
431 354 |     let _ = (1..10).skip(10).next();
432     |             ^^^^^^^^^^^^^^^^^^^^^^^
433
434 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
435    --> $DIR/methods.rs:355:14
436     |
437 355 |     let _ = &some_vec[..].iter().skip(3).next();
438     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
439
440 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
441    --> $DIR/methods.rs:381:17
442     |
443 381 |         let _ = boxed_slice.get(1).unwrap();
444     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&boxed_slice[1]`
445     |
446     = note: `-D get-unwrap` implied by `-D warnings`
447
448 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
449    --> $DIR/methods.rs:382:17
450     |
451 382 |         let _ = some_slice.get(0).unwrap();
452     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_slice[0]`
453
454 error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
455    --> $DIR/methods.rs:383:17
456     |
457 383 |         let _ = some_vec.get(0).unwrap();
458     |                 ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vec[0]`
459
460 error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
461    --> $DIR/methods.rs:384:17
462     |
463 384 |         let _ = some_vecdeque.get(0).unwrap();
464     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vecdeque[0]`
465
466 error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
467    --> $DIR/methods.rs:385:17
468     |
469 385 |         let _ = some_hashmap.get(&1).unwrap();
470     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_hashmap[&1]`
471
472 error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
473    --> $DIR/methods.rs:386:17
474     |
475 386 |         let _ = some_btreemap.get(&1).unwrap();
476     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_btreemap[&1]`
477
478 error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
479    --> $DIR/methods.rs:391:10
480     |
481 391 |         *boxed_slice.get_mut(0).unwrap() = 1;
482     |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut boxed_slice[0]`
483
484 error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
485    --> $DIR/methods.rs:392:10
486     |
487 392 |         *some_slice.get_mut(0).unwrap() = 1;
488     |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_slice[0]`
489
490 error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
491    --> $DIR/methods.rs:393:10
492     |
493 393 |         *some_vec.get_mut(0).unwrap() = 1;
494     |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_vec[0]`
495
496 error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
497    --> $DIR/methods.rs:394:10
498     |
499 394 |         *some_vecdeque.get_mut(0).unwrap() = 1;
500     |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_vecdeque[0]`
501
502 error: used unwrap() on an Option value. If you don't want to handle the None case gracefully, consider using expect() to provide a better panic message
503    --> $DIR/methods.rs:408:13
504     |
505 408 |     let _ = opt.unwrap();
506     |             ^^^^^^^^^^^^
507     |
508     = note: `-D option-unwrap-used` implied by `-D warnings`
509
510 error: used unwrap() on a Result value. If you don't want to handle the Err case gracefully, consider using expect() to provide a better panic message
511    --> $DIR/methods.rs:411:13
512     |
513 411 |     let _ = res.unwrap();
514     |             ^^^^^^^^^^^^
515     |
516     = note: `-D result-unwrap-used` implied by `-D warnings`
517
518 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
519    --> $DIR/methods.rs:413:5
520     |
521 413 |     res.ok().expect("disaster!");
522     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
523     |
524     = note: `-D ok-expect` implied by `-D warnings`
525
526 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
527    --> $DIR/methods.rs:419:5
528     |
529 419 |     res3.ok().expect("whoof");
530     |     ^^^^^^^^^^^^^^^^^^^^^^^^^
531
532 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
533    --> $DIR/methods.rs:421:5
534     |
535 421 |     res4.ok().expect("argh");
536     |     ^^^^^^^^^^^^^^^^^^^^^^^^
537
538 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
539    --> $DIR/methods.rs:423:5
540     |
541 423 |     res5.ok().expect("oops");
542     |     ^^^^^^^^^^^^^^^^^^^^^^^^
543
544 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
545    --> $DIR/methods.rs:425:5
546     |
547 425 |     res6.ok().expect("meh");
548     |     ^^^^^^^^^^^^^^^^^^^^^^^
549
550 error: calling `.extend(_.chars())`
551    --> $DIR/methods.rs:441:5
552     |
553 441 |     s.extend(abc.chars());
554     |     ^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.push_str(abc)`
555     |
556     = note: `-D string-extend-chars` implied by `-D warnings`
557
558 error: calling `.extend(_.chars())`
559    --> $DIR/methods.rs:444:5
560     |
561 444 |     s.extend("abc".chars());
562     |     ^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.push_str("abc")`
563
564 error: calling `.extend(_.chars())`
565    --> $DIR/methods.rs:447:5
566     |
567 447 |     s.extend(def.chars());
568     |     ^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.push_str(&def)`
569
570 error: using `clone` on a `Copy` type
571    --> $DIR/methods.rs:458:5
572     |
573 458 |     42.clone();
574     |     ^^^^^^^^^^ help: try removing the `clone` call: `42`
575     |
576     = note: `-D clone-on-copy` implied by `-D warnings`
577
578 error: using `clone` on a `Copy` type
579    --> $DIR/methods.rs:462:5
580     |
581 462 |     (&42).clone();
582     |     ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
583
584 error: using '.clone()' on a ref-counted pointer
585    --> $DIR/methods.rs:472:5
586     |
587 472 |     rc.clone();
588     |     ^^^^^^^^^^ help: try this: `Rc::clone(&rc)`
589     |
590     = note: `-D clone-on-ref-ptr` implied by `-D warnings`
591
592 error: using '.clone()' on a ref-counted pointer
593    --> $DIR/methods.rs:475:5
594     |
595 475 |     arc.clone();
596     |     ^^^^^^^^^^^ help: try this: `Arc::clone(&arc)`
597
598 error: using '.clone()' on a ref-counted pointer
599    --> $DIR/methods.rs:478:5
600     |
601 478 |     rcweak.clone();
602     |     ^^^^^^^^^^^^^^ help: try this: `Weak::clone(&rcweak)`
603
604 error: using '.clone()' on a ref-counted pointer
605    --> $DIR/methods.rs:481:5
606     |
607 481 |     arc_weak.clone();
608     |     ^^^^^^^^^^^^^^^^ help: try this: `Weak::clone(&arc_weak)`
609
610 error: using `clone` on a `Copy` type
611    --> $DIR/methods.rs:488:5
612     |
613 488 |     t.clone();
614     |     ^^^^^^^^^ help: try removing the `clone` call: `t`
615
616 error: using `clone` on a `Copy` type
617    --> $DIR/methods.rs:490:5
618     |
619 490 |     Some(t).clone();
620     |     ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `Some(t)`
621
622 error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type
623    --> $DIR/methods.rs:496:22
624     |
625 496 |     let z: &Vec<_> = y.clone();
626     |                      ^^^^^^^^^ help: try dereferencing it: `(*y).clone()`
627     |
628     = note: `-D clone-double-ref` implied by `-D warnings`
629
630 error: single-character string constant used as pattern
631    --> $DIR/methods.rs:503:13
632     |
633 503 |     x.split("x");
634     |     --------^^^- help: try using a char instead: `x.split('x')`
635     |
636     = note: `-D single-char-pattern` implied by `-D warnings`
637
638 error: single-character string constant used as pattern
639    --> $DIR/methods.rs:520:16
640     |
641 520 |     x.contains("x");
642     |     -----------^^^- help: try using a char instead: `x.contains('x')`
643
644 error: single-character string constant used as pattern
645    --> $DIR/methods.rs:521:19
646     |
647 521 |     x.starts_with("x");
648     |     --------------^^^- help: try using a char instead: `x.starts_with('x')`
649
650 error: single-character string constant used as pattern
651    --> $DIR/methods.rs:522:17
652     |
653 522 |     x.ends_with("x");
654     |     ------------^^^- help: try using a char instead: `x.ends_with('x')`
655
656 error: single-character string constant used as pattern
657    --> $DIR/methods.rs:523:12
658     |
659 523 |     x.find("x");
660     |     -------^^^- help: try using a char instead: `x.find('x')`
661
662 error: single-character string constant used as pattern
663    --> $DIR/methods.rs:524:13
664     |
665 524 |     x.rfind("x");
666     |     --------^^^- help: try using a char instead: `x.rfind('x')`
667
668 error: single-character string constant used as pattern
669    --> $DIR/methods.rs:525:14
670     |
671 525 |     x.rsplit("x");
672     |     ---------^^^- help: try using a char instead: `x.rsplit('x')`
673
674 error: single-character string constant used as pattern
675    --> $DIR/methods.rs:526:24
676     |
677 526 |     x.split_terminator("x");
678     |     -------------------^^^- help: try using a char instead: `x.split_terminator('x')`
679
680 error: single-character string constant used as pattern
681    --> $DIR/methods.rs:527:25
682     |
683 527 |     x.rsplit_terminator("x");
684     |     --------------------^^^- help: try using a char instead: `x.rsplit_terminator('x')`
685
686 error: single-character string constant used as pattern
687    --> $DIR/methods.rs:528:17
688     |
689 528 |     x.splitn(0, "x");
690     |     ------------^^^- help: try using a char instead: `x.splitn(0, 'x')`
691
692 error: single-character string constant used as pattern
693    --> $DIR/methods.rs:529:18
694     |
695 529 |     x.rsplitn(0, "x");
696     |     -------------^^^- help: try using a char instead: `x.rsplitn(0, 'x')`
697
698 error: single-character string constant used as pattern
699    --> $DIR/methods.rs:530:15
700     |
701 530 |     x.matches("x");
702     |     ----------^^^- help: try using a char instead: `x.matches('x')`
703
704 error: single-character string constant used as pattern
705    --> $DIR/methods.rs:531:16
706     |
707 531 |     x.rmatches("x");
708     |     -----------^^^- help: try using a char instead: `x.rmatches('x')`
709
710 error: single-character string constant used as pattern
711    --> $DIR/methods.rs:532:21
712     |
713 532 |     x.match_indices("x");
714     |     ----------------^^^- help: try using a char instead: `x.match_indices('x')`
715
716 error: single-character string constant used as pattern
717    --> $DIR/methods.rs:533:22
718     |
719 533 |     x.rmatch_indices("x");
720     |     -----------------^^^- help: try using a char instead: `x.rmatch_indices('x')`
721
722 error: single-character string constant used as pattern
723    --> $DIR/methods.rs:534:25
724     |
725 534 |     x.trim_left_matches("x");
726     |     --------------------^^^- help: try using a char instead: `x.trim_left_matches('x')`
727
728 error: single-character string constant used as pattern
729    --> $DIR/methods.rs:535:26
730     |
731 535 |     x.trim_right_matches("x");
732     |     ---------------------^^^- help: try using a char instead: `x.trim_right_matches('x')`
733
734 error: you are getting the inner pointer of a temporary `CString`
735    --> $DIR/methods.rs:545:5
736     |
737 545 |     CString::new("foo").unwrap().as_ptr();
738     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
739     |
740     = note: `-D temporary-cstring-as-ptr` implied by `-D warnings`
741     = note: that pointer will be invalid outside this expression
742 help: assign the `CString` to a variable to extend its lifetime
743    --> $DIR/methods.rs:545:5
744     |
745 545 |     CString::new("foo").unwrap().as_ptr();
746     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
747
748 error: called `cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
749    --> $DIR/methods.rs:550:27
750     |
751 550 |     let v2 : Vec<isize> = v.iter().cloned().collect();
752     |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
753     |
754     = note: `-D iter-cloned-collect` implied by `-D warnings`
755