]> git.lizzy.rs Git - rust.git/blob - tests/ui/methods.stderr
Merge pull request #2122 from sinkuu/local_span
[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: you should use the `starts_with` method
551    --> $DIR/methods.rs:437:5
552     |
553 437 |     "".chars().next() == Some(' ');
554     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".starts_with(' ')`
555     |
556     = note: `-D chars-next-cmp` implied by `-D warnings`
557
558 error: you should use the `starts_with` method
559    --> $DIR/methods.rs:438:5
560     |
561 438 |     Some(' ') != "".chars().next();
562     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".starts_with(' ')`
563
564 error: calling `.extend(_.chars())`
565    --> $DIR/methods.rs:447:5
566     |
567 447 |     s.extend(abc.chars());
568     |     ^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.push_str(abc)`
569     |
570     = note: `-D string-extend-chars` implied by `-D warnings`
571
572 error: calling `.extend(_.chars())`
573    --> $DIR/methods.rs:450:5
574     |
575 450 |     s.extend("abc".chars());
576     |     ^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.push_str("abc")`
577
578 error: calling `.extend(_.chars())`
579    --> $DIR/methods.rs:453:5
580     |
581 453 |     s.extend(def.chars());
582     |     ^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.push_str(&def)`
583
584 error: using `clone` on a `Copy` type
585    --> $DIR/methods.rs:464:5
586     |
587 464 |     42.clone();
588     |     ^^^^^^^^^^ help: try removing the `clone` call: `42`
589     |
590     = note: `-D clone-on-copy` implied by `-D warnings`
591
592 error: using `clone` on a `Copy` type
593    --> $DIR/methods.rs:468:5
594     |
595 468 |     (&42).clone();
596     |     ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
597
598 error: using '.clone()' on a ref-counted pointer
599    --> $DIR/methods.rs:478:5
600     |
601 478 |     rc.clone();
602     |     ^^^^^^^^^^ help: try this: `Rc::clone(&rc)`
603     |
604     = note: `-D clone-on-ref-ptr` implied by `-D warnings`
605
606 error: using '.clone()' on a ref-counted pointer
607    --> $DIR/methods.rs:481:5
608     |
609 481 |     arc.clone();
610     |     ^^^^^^^^^^^ help: try this: `Arc::clone(&arc)`
611
612 error: using '.clone()' on a ref-counted pointer
613    --> $DIR/methods.rs:484:5
614     |
615 484 |     rcweak.clone();
616     |     ^^^^^^^^^^^^^^ help: try this: `Weak::clone(&rcweak)`
617
618 error: using '.clone()' on a ref-counted pointer
619    --> $DIR/methods.rs:487:5
620     |
621 487 |     arc_weak.clone();
622     |     ^^^^^^^^^^^^^^^^ help: try this: `Weak::clone(&arc_weak)`
623
624 error: using `clone` on a `Copy` type
625    --> $DIR/methods.rs:494:5
626     |
627 494 |     t.clone();
628     |     ^^^^^^^^^ help: try removing the `clone` call: `t`
629
630 error: using `clone` on a `Copy` type
631    --> $DIR/methods.rs:496:5
632     |
633 496 |     Some(t).clone();
634     |     ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `Some(t)`
635
636 error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type
637    --> $DIR/methods.rs:502:22
638     |
639 502 |     let z: &Vec<_> = y.clone();
640     |                      ^^^^^^^^^ help: try dereferencing it: `(*y).clone()`
641     |
642     = note: `-D clone-double-ref` implied by `-D warnings`
643
644 error: single-character string constant used as pattern
645    --> $DIR/methods.rs:509:13
646     |
647 509 |     x.split("x");
648     |     --------^^^- help: try using a char instead: `x.split('x')`
649     |
650     = note: `-D single-char-pattern` implied by `-D warnings`
651
652 error: single-character string constant used as pattern
653    --> $DIR/methods.rs:526:16
654     |
655 526 |     x.contains("x");
656     |     -----------^^^- help: try using a char instead: `x.contains('x')`
657
658 error: single-character string constant used as pattern
659    --> $DIR/methods.rs:527:19
660     |
661 527 |     x.starts_with("x");
662     |     --------------^^^- help: try using a char instead: `x.starts_with('x')`
663
664 error: single-character string constant used as pattern
665    --> $DIR/methods.rs:528:17
666     |
667 528 |     x.ends_with("x");
668     |     ------------^^^- help: try using a char instead: `x.ends_with('x')`
669
670 error: single-character string constant used as pattern
671    --> $DIR/methods.rs:529:12
672     |
673 529 |     x.find("x");
674     |     -------^^^- help: try using a char instead: `x.find('x')`
675
676 error: single-character string constant used as pattern
677    --> $DIR/methods.rs:530:13
678     |
679 530 |     x.rfind("x");
680     |     --------^^^- help: try using a char instead: `x.rfind('x')`
681
682 error: single-character string constant used as pattern
683    --> $DIR/methods.rs:531:14
684     |
685 531 |     x.rsplit("x");
686     |     ---------^^^- help: try using a char instead: `x.rsplit('x')`
687
688 error: single-character string constant used as pattern
689    --> $DIR/methods.rs:532:24
690     |
691 532 |     x.split_terminator("x");
692     |     -------------------^^^- help: try using a char instead: `x.split_terminator('x')`
693
694 error: single-character string constant used as pattern
695    --> $DIR/methods.rs:533:25
696     |
697 533 |     x.rsplit_terminator("x");
698     |     --------------------^^^- help: try using a char instead: `x.rsplit_terminator('x')`
699
700 error: single-character string constant used as pattern
701    --> $DIR/methods.rs:534:17
702     |
703 534 |     x.splitn(0, "x");
704     |     ------------^^^- help: try using a char instead: `x.splitn(0, 'x')`
705
706 error: single-character string constant used as pattern
707    --> $DIR/methods.rs:535:18
708     |
709 535 |     x.rsplitn(0, "x");
710     |     -------------^^^- help: try using a char instead: `x.rsplitn(0, 'x')`
711
712 error: single-character string constant used as pattern
713    --> $DIR/methods.rs:536:15
714     |
715 536 |     x.matches("x");
716     |     ----------^^^- help: try using a char instead: `x.matches('x')`
717
718 error: single-character string constant used as pattern
719    --> $DIR/methods.rs:537:16
720     |
721 537 |     x.rmatches("x");
722     |     -----------^^^- help: try using a char instead: `x.rmatches('x')`
723
724 error: single-character string constant used as pattern
725    --> $DIR/methods.rs:538:21
726     |
727 538 |     x.match_indices("x");
728     |     ----------------^^^- help: try using a char instead: `x.match_indices('x')`
729
730 error: single-character string constant used as pattern
731    --> $DIR/methods.rs:539:22
732     |
733 539 |     x.rmatch_indices("x");
734     |     -----------------^^^- help: try using a char instead: `x.rmatch_indices('x')`
735
736 error: single-character string constant used as pattern
737    --> $DIR/methods.rs:540:25
738     |
739 540 |     x.trim_left_matches("x");
740     |     --------------------^^^- help: try using a char instead: `x.trim_left_matches('x')`
741
742 error: single-character string constant used as pattern
743    --> $DIR/methods.rs:541:26
744     |
745 541 |     x.trim_right_matches("x");
746     |     ---------------------^^^- help: try using a char instead: `x.trim_right_matches('x')`
747
748 error: you are getting the inner pointer of a temporary `CString`
749    --> $DIR/methods.rs:551:5
750     |
751 551 |     CString::new("foo").unwrap().as_ptr();
752     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
753     |
754     = note: `-D temporary-cstring-as-ptr` implied by `-D warnings`
755     = note: that pointer will be invalid outside this expression
756 help: assign the `CString` to a variable to extend its lifetime
757    --> $DIR/methods.rs:551:5
758     |
759 551 |     CString::new("foo").unwrap().as_ptr();
760     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
761
762 error: called `cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
763    --> $DIR/methods.rs:556:27
764     |
765 556 |     let v2 : Vec<isize> = v.iter().cloned().collect();
766     |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
767     |
768     = note: `-D iter-cloned-collect` implied by `-D warnings`
769
770 error: you should use the `starts_with` method
771    --> $DIR/methods.rs:563:8
772     |
773 563 |     if s.chars().next().unwrap() == 'f' { // s.starts_with('f')
774     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.starts_with('f')`
775
776 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
777    --> $DIR/methods.rs:563:8
778     |
779 563 |     if s.chars().next().unwrap() == 'f' { // s.starts_with('f')
780     |        ^^^^^^^^^^^^^^^^^^^^^^^^^
781
782 error: you should use the `ends_with` method
783    --> $DIR/methods.rs:566:8
784     |
785 566 |     if s.chars().next_back().unwrap() == 'o' { // s.ends_with('o')
786     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.ends_with('o')`
787     |
788     = note: `-D chars-last-cmp` implied by `-D warnings`
789
790 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
791    --> $DIR/methods.rs:566:8
792     |
793 566 |     if s.chars().next_back().unwrap() == 'o' { // s.ends_with('o')
794     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
795
796 error: you should use the `ends_with` method
797    --> $DIR/methods.rs:569:8
798     |
799 569 |     if s.chars().last().unwrap() == 'o' { // s.ends_with('o')
800     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.ends_with('o')`
801
802 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
803    --> $DIR/methods.rs:569:8
804     |
805 569 |     if s.chars().last().unwrap() == 'o' { // s.ends_with('o')
806     |        ^^^^^^^^^^^^^^^^^^^^^^^^^
807
808 error: you should use the `starts_with` method
809    --> $DIR/methods.rs:572:8
810     |
811 572 |     if s.chars().next().unwrap() != 'f' { // !s.starts_with('f')
812     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.starts_with('f')`
813
814 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
815    --> $DIR/methods.rs:572:8
816     |
817 572 |     if s.chars().next().unwrap() != 'f' { // !s.starts_with('f')
818     |        ^^^^^^^^^^^^^^^^^^^^^^^^^
819
820 error: you should use the `ends_with` method
821    --> $DIR/methods.rs:575:8
822     |
823 575 |     if s.chars().next_back().unwrap() != 'o' { // !s.ends_with('o')
824     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.ends_with('o')`
825
826 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
827    --> $DIR/methods.rs:575:8
828     |
829 575 |     if s.chars().next_back().unwrap() != 'o' { // !s.ends_with('o')
830     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
831
832 error: you should use the `ends_with` method
833    --> $DIR/methods.rs:578:8
834     |
835 578 |     if s.chars().last().unwrap() != 'o' { // !s.ends_with('o')
836     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.ends_with('o')`
837
838 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
839    --> $DIR/methods.rs:578:8
840     |
841 578 |     if s.chars().last().unwrap() != 'o' { // !s.ends_with('o')
842     |        ^^^^^^^^^^^^^^^^^^^^^^^^^
843
844 error: you should use the `ends_with` method
845    --> $DIR/methods.rs:585:5
846     |
847 585 |     "".chars().last() == Some(' ');
848     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".ends_with(' ')`
849
850 error: you should use the `ends_with` method
851    --> $DIR/methods.rs:586:5
852     |
853 586 |     Some(' ') != "".chars().last();
854     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".ends_with(' ')`
855
856 error: you should use the `ends_with` method
857    --> $DIR/methods.rs:587:5
858     |
859 587 |     "".chars().next_back() == Some(' ');
860     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".ends_with(' ')`
861
862 error: you should use the `ends_with` method
863    --> $DIR/methods.rs:588:5
864     |
865 588 |     Some(' ') != "".chars().next_back();
866     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".ends_with(' ')`
867