]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/suspicious_to_owned.stderr
New upstream version 1.74.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / suspicious_to_owned.stderr
CommitLineData
9c376795 1error: this `to_owned` call clones the Cow<'_, str> itself and does not cause the Cow<'_, str> contents to become owned
781aab86 2 --> $DIR/suspicious_to_owned.rs:17:13
f2b60f7d
FG
3 |
4LL | let _ = cow.to_owned();
9ffffee4 5 | ^^^^^^^^^^^^^^
f2b60f7d
FG
6 |
7 = note: `-D clippy::suspicious-to-owned` implied by `-D warnings`
781aab86 8 = help: to override `-D warnings` add `#[allow(clippy::suspicious_to_owned)]`
9ffffee4
FG
9help: depending on intent, either make the Cow an Owned variant
10 |
11LL | let _ = cow.into_owned();
12 | ~~~~~~~~~~~~~~~~
13help: or clone the Cow itself
14 |
15LL | let _ = cow.clone();
16 | ~~~~~~~~~~~
f2b60f7d 17
9c376795 18error: this `to_owned` call clones the Cow<'_, [char; 3]> itself and does not cause the Cow<'_, [char; 3]> contents to become owned
781aab86 19 --> $DIR/suspicious_to_owned.rs:29:13
f2b60f7d
FG
20 |
21LL | let _ = cow.to_owned();
9ffffee4
FG
22 | ^^^^^^^^^^^^^^
23 |
24help: depending on intent, either make the Cow an Owned variant
25 |
26LL | let _ = cow.into_owned();
27 | ~~~~~~~~~~~~~~~~
28help: or clone the Cow itself
29 |
30LL | let _ = cow.clone();
31 | ~~~~~~~~~~~
f2b60f7d 32
9c376795 33error: this `to_owned` call clones the Cow<'_, Vec<char>> itself and does not cause the Cow<'_, Vec<char>> contents to become owned
781aab86 34 --> $DIR/suspicious_to_owned.rs:40:13
f2b60f7d
FG
35 |
36LL | let _ = cow.to_owned();
9ffffee4
FG
37 | ^^^^^^^^^^^^^^
38 |
39help: depending on intent, either make the Cow an Owned variant
40 |
41LL | let _ = cow.into_owned();
42 | ~~~~~~~~~~~~~~~~
43help: or clone the Cow itself
44 |
45LL | let _ = cow.clone();
46 | ~~~~~~~~~~~
f2b60f7d 47
9c376795 48error: this `to_owned` call clones the Cow<'_, str> itself and does not cause the Cow<'_, str> contents to become owned
781aab86 49 --> $DIR/suspicious_to_owned.rs:51:13
f2b60f7d
FG
50 |
51LL | let _ = cow.to_owned();
9ffffee4
FG
52 | ^^^^^^^^^^^^^^
53 |
54help: depending on intent, either make the Cow an Owned variant
55 |
56LL | let _ = cow.into_owned();
57 | ~~~~~~~~~~~~~~~~
58help: or clone the Cow itself
59 |
60LL | let _ = cow.clone();
61 | ~~~~~~~~~~~
f2b60f7d
FG
62
63error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
781aab86 64 --> $DIR/suspicious_to_owned.rs:66:13
f2b60f7d
FG
65 |
66LL | let _ = String::from(moo).to_owned();
67 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `String::from(moo).clone()`
68 |
69 = note: `-D clippy::implicit-clone` implied by `-D warnings`
781aab86 70 = help: to override `-D warnings` add `#[allow(clippy::implicit_clone)]`
f2b60f7d
FG
71
72error: implicitly cloning a `Vec` by calling `to_owned` on its dereferenced type
781aab86 73 --> $DIR/suspicious_to_owned.rs:69:13
f2b60f7d
FG
74 |
75LL | let _ = moos_vec.to_owned();
76 | ^^^^^^^^^^^^^^^^^^^ help: consider using: `moos_vec.clone()`
77
78error: aborting due to 6 previous errors
79