Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 46edafe

Browse files
committed
blessed stderr output
1 parent 1fb42da commit 46edafe

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

tests/ui/suspicious_to_owned.stderr

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,54 @@ error: this `to_owned` call clones the Cow<'_, str> itself and does not cause th
22
--> $DIR/suspicious_to_owned.rs:16:13
33
|
44
LL | let _ = cow.to_owned();
5-
| ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_owned()`
5+
| ^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::suspicious-to-owned` implied by `-D warnings`
8+
help: depending on intent, either make the Cow an Owned variant or clone the Cow itself
9+
|
10+
LL | let _ = cow.clone();
11+
| ~~~~~~~~~~~
12+
LL | let _ = cow.into_owned();
13+
| ~~~~~~~~~~~~~~~~
814

915
error: this `to_owned` call clones the Cow<'_, [char; 3]> itself and does not cause the Cow<'_, [char; 3]> contents to become owned
1016
--> $DIR/suspicious_to_owned.rs:26:13
1117
|
1218
LL | let _ = cow.to_owned();
13-
| ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_owned()`
19+
| ^^^^^^^^^^^^^^
20+
|
21+
help: depending on intent, either make the Cow an Owned variant or clone the Cow itself
22+
|
23+
LL | let _ = cow.clone();
24+
| ~~~~~~~~~~~
25+
LL | let _ = cow.into_owned();
26+
| ~~~~~~~~~~~~~~~~
1427

1528
error: this `to_owned` call clones the Cow<'_, Vec<char>> itself and does not cause the Cow<'_, Vec<char>> contents to become owned
1629
--> $DIR/suspicious_to_owned.rs:36:13
1730
|
1831
LL | let _ = cow.to_owned();
19-
| ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_owned()`
32+
| ^^^^^^^^^^^^^^
33+
|
34+
help: depending on intent, either make the Cow an Owned variant or clone the Cow itself
35+
|
36+
LL | let _ = cow.clone();
37+
| ~~~~~~~~~~~
38+
LL | let _ = cow.into_owned();
39+
| ~~~~~~~~~~~~~~~~
2040

2141
error: this `to_owned` call clones the Cow<'_, str> itself and does not cause the Cow<'_, str> contents to become owned
2242
--> $DIR/suspicious_to_owned.rs:46:13
2343
|
2444
LL | let _ = cow.to_owned();
25-
| ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_owned()`
45+
| ^^^^^^^^^^^^^^
46+
|
47+
help: depending on intent, either make the Cow an Owned variant or clone the Cow itself
48+
|
49+
LL | let _ = cow.clone();
50+
| ~~~~~~~~~~~
51+
LL | let _ = cow.into_owned();
52+
| ~~~~~~~~~~~~~~~~
2653

2754
error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
2855
--> $DIR/suspicious_to_owned.rs:60:13

0 commit comments

Comments
 (0)