1 error: unnecessary structure name repetition
2 --> $DIR/methods.rs:20:25
4 20 | fn add(self, other: T) -> T { self }
5 | ^ help: use the applicable keyword: `Self`
7 = note: `-D use-self` implied by `-D warnings`
9 error: unnecessary structure name repetition
10 --> $DIR/methods.rs:20:31
12 20 | fn add(self, other: T) -> T { self }
13 | ^ help: use the applicable keyword: `Self`
15 error: unnecessary structure name repetition
16 --> $DIR/methods.rs:23:26
18 23 | fn sub(&self, other: T) -> &T { self } // no error, self is a ref
19 | ^ help: use the applicable keyword: `Self`
21 error: unnecessary structure name repetition
22 --> $DIR/methods.rs:23:33
24 23 | fn sub(&self, other: T) -> &T { self } // no error, self is a ref
25 | ^ help: use the applicable keyword: `Self`
27 error: unnecessary structure name repetition
28 --> $DIR/methods.rs:24:21
30 24 | fn div(self) -> T { self } // no error, different #arguments
31 | ^ help: use the applicable keyword: `Self`
33 error: unnecessary structure name repetition
34 --> $DIR/methods.rs:25:25
36 25 | fn rem(self, other: T) { } // no error, wrong return type
37 | ^ help: use the applicable keyword: `Self`
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
42 20 | fn add(self, other: T) -> T { self }
43 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45 = note: `-D should-implement-trait` implied by `-D warnings`
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
50 21 | fn drop(&mut self) { }
51 | ^^^^^^^^^^^^^^^^^^^^^^
53 error: methods called `into_*` usually take self by value; consider choosing a less ambiguous name
54 --> $DIR/methods.rs:28:17
56 28 | fn into_u16(&self) -> u16 { 0 }
59 = note: `-D wrong-self-convention` implied by `-D warnings`
61 error: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name
62 --> $DIR/methods.rs:30:21
64 30 | fn to_something(self) -> u32 { 0 }
67 error: methods called `new` usually take no self; consider choosing a less ambiguous name
68 --> $DIR/methods.rs:32:12
73 error: methods called `new` usually return `Self`
74 --> $DIR/methods.rs:32:5
79 = note: `-D new-ret-no-self` implied by `-D warnings`
81 error: unnecessary structure name repetition
82 --> $DIR/methods.rs:76:24
84 76 | fn new() -> Option<V<T>> { None }
85 | ^^^^ help: use the applicable keyword: `Self`
87 error: unnecessary structure name repetition
88 --> $DIR/methods.rs:80:19
91 | ^ help: use the applicable keyword: `Self`
93 error: unnecessary structure name repetition
94 --> $DIR/methods.rs:81:25
96 81 | fn mul(self, other: T) -> T { self } // no error, obviously
97 | ^ help: use the applicable keyword: `Self`
99 error: unnecessary structure name repetition
100 --> $DIR/methods.rs:81:31
102 81 | fn mul(self, other: T) -> T { self } // no error, obviously
103 | ^ help: use the applicable keyword: `Self`
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
108 99 | let _ = opt.map(|x| x + 1)
111 101 | | .unwrap_or(0); // should lint even though this call is on a separate line
112 | |____________________________^
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)`
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
120 103 | let _ = opt.map(|x| {
124 106 | | ).unwrap_or(0);
125 | |____________________________^
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
130 107 | let _ = opt.map(|x| x + 1)
135 | |__________________^
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
140 112 | let _ = opt.map(|x| Some(x + 1)).unwrap_or(None);
141 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
143 = note: replace `map(|x| Some(x + 1)).unwrap_or(None)` with `and_then(|x| Some(x + 1))`
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
148 114 | let _ = opt.map(|x| {
152 117 | | ).unwrap_or(None);
153 | |_____________________^
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
160 119 | | .map(|x| Some(x + 1))
161 120 | | .unwrap_or(None);
162 | |________________________^
164 = note: replace `map(|x| Some(x + 1)).unwrap_or(None)` with `and_then(|x| Some(x + 1))`
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
169 126 | let _ = opt.map(|x| x + 1)
172 128 | | .unwrap_or_else(|| 0); // should lint even though this call is on a separate line
173 | |____________________________________^
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)`
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
181 130 | let _ = opt.map(|x| {
185 133 | | ).unwrap_or_else(|| 0);
186 | |____________________________________^
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
191 134 | let _ = opt.map(|x| x + 1)
193 135 | | .unwrap_or_else(||
196 | |_________________^
198 error: unnecessary structure name repetition
199 --> $DIR/methods.rs:163:24
201 163 | fn filter(self) -> IteratorFalsePositives {
202 | ^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
204 error: unnecessary structure name repetition
205 --> $DIR/methods.rs:167:22
207 167 | fn next(self) -> IteratorFalsePositives {
208 | ^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
210 error: unnecessary structure name repetition
211 --> $DIR/methods.rs:187:32
213 187 | fn skip(self, _: usize) -> IteratorFalsePositives {
214 | ^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
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
219 206 | let _ = v.iter().filter(|&x| *x < 0).next();
220 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
222 = note: `-D filter-next` implied by `-D warnings`
223 = note: replace `filter(|&x| *x < 0).next()` with `find(|&x| *x < 0)`
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
228 209 | let _ = v.iter().filter(|&x| {
233 | |___________________________^
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
238 224 | let _ = v.iter().find(|&x| *x < 0).is_some();
239 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
241 = note: `-D search-is-some` implied by `-D warnings`
242 = note: replace `find(|&x| *x < 0).is_some()` with `any(|&x| *x < 0)`
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
247 227 | let _ = v.iter().find(|&x| {
252 | |______________________________^
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
257 233 | let _ = v.iter().position(|&x| x < 0).is_some();
258 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
260 = note: replace `position(|&x| x < 0).is_some()` with `any(|&x| x < 0)`
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
265 236 | let _ = v.iter().position(|&x| {
270 | |______________________________^
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
275 242 | let _ = v.iter().rposition(|&x| x < 0).is_some();
276 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
278 = note: replace `rposition(|&x| x < 0).is_some()` with `any(|&x| x < 0)`
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
283 245 | let _ = v.iter().rposition(|&x| {
288 | |______________________________^
290 error: unnecessary structure name repetition
291 --> $DIR/methods.rs:262:21
293 262 | fn new() -> Foo { Foo }
294 | ^^^ help: use the applicable keyword: `Self`
296 error: use of `unwrap_or` followed by a function call
297 --> $DIR/methods.rs:280:5
299 280 | with_constructor.unwrap_or(make());
300 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_constructor.unwrap_or_else(make)`
302 = note: `-D or-fun-call` implied by `-D warnings`
304 error: use of `unwrap_or` followed by a call to `new`
305 --> $DIR/methods.rs:283:5
307 283 | with_new.unwrap_or(Vec::new());
308 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_new.unwrap_or_default()`
310 error: use of `unwrap_or` followed by a function call
311 --> $DIR/methods.rs:286:5
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))`
316 error: use of `unwrap_or` followed by a function call
317 --> $DIR/methods.rs:289:5
319 289 | with_err.unwrap_or(make());
320 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_err.unwrap_or_else(|_| make())`
322 error: use of `unwrap_or` followed by a function call
323 --> $DIR/methods.rs:292:5
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))`
328 error: use of `unwrap_or` followed by a call to `default`
329 --> $DIR/methods.rs:295:5
331 295 | with_default_trait.unwrap_or(Default::default());
332 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_trait.unwrap_or_default()`
334 error: use of `unwrap_or` followed by a call to `default`
335 --> $DIR/methods.rs:298:5
337 298 | with_default_type.unwrap_or(u64::default());
338 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_type.unwrap_or_default()`
340 error: use of `unwrap_or` followed by a function call
341 --> $DIR/methods.rs:301:5
343 301 | with_vec.unwrap_or(vec![]);
344 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_vec.unwrap_or_else(|| < [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ))`
346 error: use of `unwrap_or` followed by a function call
347 --> $DIR/methods.rs:306:5
349 306 | without_default.unwrap_or(Foo::new());
350 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `without_default.unwrap_or_else(Foo::new)`
352 error: use of `or_insert` followed by a function call
353 --> $DIR/methods.rs:309:5
355 309 | map.entry(42).or_insert(String::new());
356 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `map.entry(42).or_insert_with(String::new)`
358 error: use of `or_insert` followed by a function call
359 --> $DIR/methods.rs:312:5
361 312 | btree.entry(42).or_insert(String::new());
362 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `btree.entry(42).or_insert_with(String::new)`
364 error: use of `unwrap_or` followed by a function call
365 --> $DIR/methods.rs:315:13
367 315 | let _ = stringy.unwrap_or("".to_owned());
368 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `stringy.unwrap_or_else(|| "".to_owned())`
370 error: called `.iter().nth()` on a Vec. Calling `.get()` is both faster and more readable
371 --> $DIR/methods.rs:326:23
373 326 | let bad_vec = some_vec.iter().nth(3);
374 | ^^^^^^^^^^^^^^^^^^^^^^
376 = note: `-D iter-nth` implied by `-D warnings`
378 error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
379 --> $DIR/methods.rs:327:26
381 327 | let bad_slice = &some_vec[..].iter().nth(3);
382 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
384 error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
385 --> $DIR/methods.rs:328:31
387 328 | let bad_boxed_slice = boxed_slice.iter().nth(3);
388 | ^^^^^^^^^^^^^^^^^^^^^^^^^
390 error: called `.iter().nth()` on a VecDeque. Calling `.get()` is both faster and more readable
391 --> $DIR/methods.rs:329:29
393 329 | let bad_vec_deque = some_vec_deque.iter().nth(3);
394 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
396 error: called `.iter_mut().nth()` on a Vec. Calling `.get_mut()` is both faster and more readable
397 --> $DIR/methods.rs:334:23
399 334 | let bad_vec = some_vec.iter_mut().nth(3);
400 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
402 error: called `.iter_mut().nth()` on a slice. Calling `.get_mut()` is both faster and more readable
403 --> $DIR/methods.rs:337:26
405 337 | let bad_slice = &some_vec[..].iter_mut().nth(3);
406 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
408 error: called `.iter_mut().nth()` on a VecDeque. Calling `.get_mut()` is both faster and more readable
409 --> $DIR/methods.rs:340:29
411 340 | let bad_vec_deque = some_vec_deque.iter_mut().nth(3);
412 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
414 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
415 --> $DIR/methods.rs:352:13
417 352 | let _ = some_vec.iter().skip(42).next();
418 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
420 = note: `-D iter-skip-next` implied by `-D warnings`
422 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
423 --> $DIR/methods.rs:353:13
425 353 | let _ = some_vec.iter().cycle().skip(42).next();
426 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
428 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
429 --> $DIR/methods.rs:354:13
431 354 | let _ = (1..10).skip(10).next();
432 | ^^^^^^^^^^^^^^^^^^^^^^^
434 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
435 --> $DIR/methods.rs:355:14
437 355 | let _ = &some_vec[..].iter().skip(3).next();
438 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
440 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
441 --> $DIR/methods.rs:381:17
443 381 | let _ = boxed_slice.get(1).unwrap();
444 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&boxed_slice[1]`
446 = note: `-D get-unwrap` implied by `-D warnings`
448 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
449 --> $DIR/methods.rs:382:17
451 382 | let _ = some_slice.get(0).unwrap();
452 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_slice[0]`
454 error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
455 --> $DIR/methods.rs:383:17
457 383 | let _ = some_vec.get(0).unwrap();
458 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vec[0]`
460 error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
461 --> $DIR/methods.rs:384:17
463 384 | let _ = some_vecdeque.get(0).unwrap();
464 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vecdeque[0]`
466 error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
467 --> $DIR/methods.rs:385:17
469 385 | let _ = some_hashmap.get(&1).unwrap();
470 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_hashmap[&1]`
472 error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
473 --> $DIR/methods.rs:386:17
475 386 | let _ = some_btreemap.get(&1).unwrap();
476 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_btreemap[&1]`
478 error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
479 --> $DIR/methods.rs:391:10
481 391 | *boxed_slice.get_mut(0).unwrap() = 1;
482 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut boxed_slice[0]`
484 error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
485 --> $DIR/methods.rs:392:10
487 392 | *some_slice.get_mut(0).unwrap() = 1;
488 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_slice[0]`
490 error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
491 --> $DIR/methods.rs:393:10
493 393 | *some_vec.get_mut(0).unwrap() = 1;
494 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_vec[0]`
496 error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
497 --> $DIR/methods.rs:394:10
499 394 | *some_vecdeque.get_mut(0).unwrap() = 1;
500 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_vecdeque[0]`
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
505 408 | let _ = opt.unwrap();
508 = note: `-D option-unwrap-used` implied by `-D warnings`
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
513 411 | let _ = res.unwrap();
516 = note: `-D result-unwrap-used` implied by `-D warnings`
518 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
519 --> $DIR/methods.rs:413:5
521 413 | res.ok().expect("disaster!");
522 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
524 = note: `-D ok-expect` implied by `-D warnings`
526 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
527 --> $DIR/methods.rs:419:5
529 419 | res3.ok().expect("whoof");
530 | ^^^^^^^^^^^^^^^^^^^^^^^^^
532 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
533 --> $DIR/methods.rs:421:5
535 421 | res4.ok().expect("argh");
536 | ^^^^^^^^^^^^^^^^^^^^^^^^
538 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
539 --> $DIR/methods.rs:423:5
541 423 | res5.ok().expect("oops");
542 | ^^^^^^^^^^^^^^^^^^^^^^^^
544 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
545 --> $DIR/methods.rs:425:5
547 425 | res6.ok().expect("meh");
548 | ^^^^^^^^^^^^^^^^^^^^^^^
550 error: calling `.extend(_.chars())`
551 --> $DIR/methods.rs:441:5
553 441 | s.extend(abc.chars());
554 | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.push_str(abc)`
556 = note: `-D string-extend-chars` implied by `-D warnings`
558 error: calling `.extend(_.chars())`
559 --> $DIR/methods.rs:444:5
561 444 | s.extend("abc".chars());
562 | ^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.push_str("abc")`
564 error: calling `.extend(_.chars())`
565 --> $DIR/methods.rs:447:5
567 447 | s.extend(def.chars());
568 | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.push_str(&def)`
570 error: using `clone` on a `Copy` type
571 --> $DIR/methods.rs:458:5
574 | ^^^^^^^^^^ help: try removing the `clone` call: `42`
576 = note: `-D clone-on-copy` implied by `-D warnings`
578 error: using `clone` on a `Copy` type
579 --> $DIR/methods.rs:462:5
582 | ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
584 error: using '.clone()' on a ref-counted pointer
585 --> $DIR/methods.rs:472:5
588 | ^^^^^^^^^^ help: try this: `Rc::clone(&rc)`
590 = note: `-D clone-on-ref-ptr` implied by `-D warnings`
592 error: using '.clone()' on a ref-counted pointer
593 --> $DIR/methods.rs:475:5
596 | ^^^^^^^^^^^ help: try this: `Arc::clone(&arc)`
598 error: using '.clone()' on a ref-counted pointer
599 --> $DIR/methods.rs:478:5
601 478 | rcweak.clone();
602 | ^^^^^^^^^^^^^^ help: try this: `Weak::clone(&rcweak)`
604 error: using '.clone()' on a ref-counted pointer
605 --> $DIR/methods.rs:481:5
607 481 | arc_weak.clone();
608 | ^^^^^^^^^^^^^^^^ help: try this: `Weak::clone(&arc_weak)`
610 error: using `clone` on a `Copy` type
611 --> $DIR/methods.rs:488:5
614 | ^^^^^^^^^ help: try removing the `clone` call: `t`
616 error: using `clone` on a `Copy` type
617 --> $DIR/methods.rs:490:5
619 490 | Some(t).clone();
620 | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `Some(t)`
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
625 496 | let z: &Vec<_> = y.clone();
626 | ^^^^^^^^^ help: try dereferencing it: `(*y).clone()`
628 = note: `-D clone-double-ref` implied by `-D warnings`
630 error: single-character string constant used as pattern
631 --> $DIR/methods.rs:503:13
634 | --------^^^- help: try using a char instead: `x.split('x')`
636 = note: `-D single-char-pattern` implied by `-D warnings`
638 error: single-character string constant used as pattern
639 --> $DIR/methods.rs:520:16
641 520 | x.contains("x");
642 | -----------^^^- help: try using a char instead: `x.contains('x')`
644 error: single-character string constant used as pattern
645 --> $DIR/methods.rs:521:19
647 521 | x.starts_with("x");
648 | --------------^^^- help: try using a char instead: `x.starts_with('x')`
650 error: single-character string constant used as pattern
651 --> $DIR/methods.rs:522:17
653 522 | x.ends_with("x");
654 | ------------^^^- help: try using a char instead: `x.ends_with('x')`
656 error: single-character string constant used as pattern
657 --> $DIR/methods.rs:523:12
660 | -------^^^- help: try using a char instead: `x.find('x')`
662 error: single-character string constant used as pattern
663 --> $DIR/methods.rs:524:13
666 | --------^^^- help: try using a char instead: `x.rfind('x')`
668 error: single-character string constant used as pattern
669 --> $DIR/methods.rs:525:14
672 | ---------^^^- help: try using a char instead: `x.rsplit('x')`
674 error: single-character string constant used as pattern
675 --> $DIR/methods.rs:526:24
677 526 | x.split_terminator("x");
678 | -------------------^^^- help: try using a char instead: `x.split_terminator('x')`
680 error: single-character string constant used as pattern
681 --> $DIR/methods.rs:527:25
683 527 | x.rsplit_terminator("x");
684 | --------------------^^^- help: try using a char instead: `x.rsplit_terminator('x')`
686 error: single-character string constant used as pattern
687 --> $DIR/methods.rs:528:17
689 528 | x.splitn(0, "x");
690 | ------------^^^- help: try using a char instead: `x.splitn(0, 'x')`
692 error: single-character string constant used as pattern
693 --> $DIR/methods.rs:529:18
695 529 | x.rsplitn(0, "x");
696 | -------------^^^- help: try using a char instead: `x.rsplitn(0, 'x')`
698 error: single-character string constant used as pattern
699 --> $DIR/methods.rs:530:15
701 530 | x.matches("x");
702 | ----------^^^- help: try using a char instead: `x.matches('x')`
704 error: single-character string constant used as pattern
705 --> $DIR/methods.rs:531:16
707 531 | x.rmatches("x");
708 | -----------^^^- help: try using a char instead: `x.rmatches('x')`
710 error: single-character string constant used as pattern
711 --> $DIR/methods.rs:532:21
713 532 | x.match_indices("x");
714 | ----------------^^^- help: try using a char instead: `x.match_indices('x')`
716 error: single-character string constant used as pattern
717 --> $DIR/methods.rs:533:22
719 533 | x.rmatch_indices("x");
720 | -----------------^^^- help: try using a char instead: `x.rmatch_indices('x')`
722 error: single-character string constant used as pattern
723 --> $DIR/methods.rs:534:25
725 534 | x.trim_left_matches("x");
726 | --------------------^^^- help: try using a char instead: `x.trim_left_matches('x')`
728 error: single-character string constant used as pattern
729 --> $DIR/methods.rs:535:26
731 535 | x.trim_right_matches("x");
732 | ---------------------^^^- help: try using a char instead: `x.trim_right_matches('x')`
734 error: you are getting the inner pointer of a temporary `CString`
735 --> $DIR/methods.rs:545:5
737 545 | CString::new("foo").unwrap().as_ptr();
738 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
745 545 | CString::new("foo").unwrap().as_ptr();
746 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
751 550 | let v2 : Vec<isize> = v.iter().cloned().collect();
752 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
754 = note: `-D iter-cloned-collect` implied by `-D warnings`