summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/suspicious_to_owned.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
commit4f9fe856a25ab29345b90e7725509e9ee38a37be (patch)
treee4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /src/tools/clippy/tests/ui/suspicious_to_owned.stderr
parentAdding upstream version 1.68.2+dfsg1. (diff)
downloadrustc-4f9fe856a25ab29345b90e7725509e9ee38a37be.tar.xz
rustc-4f9fe856a25ab29345b90e7725509e9ee38a37be.zip
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/tools/clippy/tests/ui/suspicious_to_owned.stderr43
1 files changed, 39 insertions, 4 deletions
diff --git a/src/tools/clippy/tests/ui/suspicious_to_owned.stderr b/src/tools/clippy/tests/ui/suspicious_to_owned.stderr
index dec3f50d6..c4ec7aa88 100644
--- a/src/tools/clippy/tests/ui/suspicious_to_owned.stderr
+++ b/src/tools/clippy/tests/ui/suspicious_to_owned.stderr
@@ -2,27 +2,62 @@ error: this `to_owned` call clones the Cow<'_, str> itself and does not cause th
--> $DIR/suspicious_to_owned.rs:16:13
|
LL | let _ = cow.to_owned();
- | ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_owned()`
+ | ^^^^^^^^^^^^^^
|
= note: `-D clippy::suspicious-to-owned` implied by `-D warnings`
+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:26:13
|
LL | let _ = cow.to_owned();
- | ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_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:36:13
|
LL | let _ = cow.to_owned();
- | ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_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:46:13
|
LL | let _ = cow.to_owned();
- | ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_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:60:13