summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/suspicious_to_owned.stderr
blob: eb967a714d9490af3a35cb8b426660f23270d848 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
error: this `to_owned` call clones the Cow<'_, str> itself and does not cause the Cow<'_, str> contents to become owned
  --> $DIR/suspicious_to_owned.rs:17:13
   |
LL |     let _ = cow.to_owned();
   |             ^^^^^^^^^^^^^^
   |
   = note: `-D clippy::suspicious-to-owned` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::suspicious_to_owned)]`
help: depending on intent, either make the Cow an Owned variant
   |
LL |     let _ = cow.into_owned();
   |             ~~~~~~~~~~~~~~~~
help: or clone the Cow itself
   |
LL |     let _ = cow.clone();
   |             ~~~~~~~~~~~

error: this `to_owned` call clones the Cow<'_, [char; 3]> itself and does not cause the Cow<'_, [char; 3]> contents to become owned
  --> $DIR/suspicious_to_owned.rs:29:13
   |
LL |     let _ = cow.to_owned();
   |             ^^^^^^^^^^^^^^
   |
help: depending on intent, either make the Cow an Owned variant
   |
LL |     let _ = cow.into_owned();
   |             ~~~~~~~~~~~~~~~~
help: or clone the Cow itself
   |
LL |     let _ = cow.clone();
   |             ~~~~~~~~~~~

error: this `to_owned` call clones the Cow<'_, Vec<char>> itself and does not cause the Cow<'_, Vec<char>> contents to become owned
  --> $DIR/suspicious_to_owned.rs:40:13
   |
LL |     let _ = cow.to_owned();
   |             ^^^^^^^^^^^^^^
   |
help: depending on intent, either make the Cow an Owned variant
   |
LL |     let _ = cow.into_owned();
   |             ~~~~~~~~~~~~~~~~
help: or clone the Cow itself
   |
LL |     let _ = cow.clone();
   |             ~~~~~~~~~~~

error: this `to_owned` call clones the Cow<'_, str> itself and does not cause the Cow<'_, str> contents to become owned
  --> $DIR/suspicious_to_owned.rs:51:13
   |
LL |     let _ = cow.to_owned();
   |             ^^^^^^^^^^^^^^
   |
help: depending on intent, either make the Cow an Owned variant
   |
LL |     let _ = cow.into_owned();
   |             ~~~~~~~~~~~~~~~~
help: or clone the Cow itself
   |
LL |     let _ = cow.clone();
   |             ~~~~~~~~~~~

error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
  --> $DIR/suspicious_to_owned.rs:66:13
   |
LL |     let _ = String::from(moo).to_owned();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `String::from(moo).clone()`
   |
   = note: `-D clippy::implicit-clone` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::implicit_clone)]`

error: implicitly cloning a `Vec` by calling `to_owned` on its dereferenced type
  --> $DIR/suspicious_to_owned.rs:69:13
   |
LL |     let _ = moos_vec.to_owned();
   |             ^^^^^^^^^^^^^^^^^^^ help: consider using: `moos_vec.clone()`

error: aborting due to 6 previous errors