]> git.lizzy.rs Git - rust.git/blob - tests/ui/suspicious_to_owned.stderr
Merge remote-tracking branch 'upstream/master' into rustup
[rust.git] / tests / ui / suspicious_to_owned.stderr
1 error: this `to_owned` call clones the std::borrow::Cow<'_, str> itself and does not cause the std::borrow::Cow<'_, str> contents to become owned
2   --> $DIR/suspicious_to_owned.rs:16:13
3    |
4 LL |     let _ = cow.to_owned();
5    |             ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_owned()`
6    |
7    = note: `-D clippy::suspicious-to-owned` implied by `-D warnings`
8
9 error: this `to_owned` call clones the std::borrow::Cow<'_, [char; 3]> itself and does not cause the std::borrow::Cow<'_, [char; 3]> contents to become owned
10   --> $DIR/suspicious_to_owned.rs:26:13
11    |
12 LL |     let _ = cow.to_owned();
13    |             ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_owned()`
14
15 error: this `to_owned` call clones the std::borrow::Cow<'_, std::vec::Vec<char>> itself and does not cause the std::borrow::Cow<'_, std::vec::Vec<char>> contents to become owned
16   --> $DIR/suspicious_to_owned.rs:36:13
17    |
18 LL |     let _ = cow.to_owned();
19    |             ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_owned()`
20
21 error: this `to_owned` call clones the std::borrow::Cow<'_, str> itself and does not cause the std::borrow::Cow<'_, str> contents to become owned
22   --> $DIR/suspicious_to_owned.rs:46:13
23    |
24 LL |     let _ = cow.to_owned();
25    |             ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_owned()`
26
27 error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
28   --> $DIR/suspicious_to_owned.rs:60:13
29    |
30 LL |     let _ = String::from(moo).to_owned();
31    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `String::from(moo).clone()`
32    |
33    = note: `-D clippy::implicit-clone` implied by `-D warnings`
34
35 error: implicitly cloning a `Vec` by calling `to_owned` on its dereferenced type
36   --> $DIR/suspicious_to_owned.rs:61:13
37    |
38 LL |     let _ = moos_vec.to_owned();
39    |             ^^^^^^^^^^^^^^^^^^^ help: consider using: `moos_vec.clone()`
40
41 error: aborting due to 6 previous errors
42