diff options
| author | Kartavya Vashishtha <sendtokartavya@gmail.com> | 2023-02-05 01:18:29 +0530 |
|---|---|---|
| committer | Kartavya Vashishtha <sendtokartavya@gmail.com> | 2023-02-05 01:18:29 +0530 |
| commit | 46edafe8c1df5fd4aef6492cee0a96e72bb428ba (patch) | |
| tree | c40ed88f1de6c8b71245fcb8af30610482958c3c | |
| parent | 1fb42daf11e68393f2cf9eb8e67e4b2779a4bf5e (diff) | |
| download | rust-46edafe8c1df5fd4aef6492cee0a96e72bb428ba.tar.gz rust-46edafe8c1df5fd4aef6492cee0a96e72bb428ba.zip | |
blessed stderr output
| -rw-r--r-- | tests/ui/suspicious_to_owned.stderr | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/tests/ui/suspicious_to_owned.stderr b/tests/ui/suspicious_to_owned.stderr index dec3f50d6f1..2d8bbf0d6f1 100644 --- a/tests/ui/suspicious_to_owned.stderr +++ b/tests/ui/suspicious_to_owned.stderr @@ -2,27 +2,54 @@ 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 or clone the Cow itself + | +LL | let _ = cow.clone(); + | ~~~~~~~~~~~ +LL | let _ = cow.into_owned(); + | ~~~~~~~~~~~~~~~~ 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 or clone the Cow itself + | +LL | let _ = cow.clone(); + | ~~~~~~~~~~~ +LL | let _ = cow.into_owned(); + | ~~~~~~~~~~~~~~~~ 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 or clone the Cow itself + | +LL | let _ = cow.clone(); + | ~~~~~~~~~~~ +LL | let _ = cow.into_owned(); + | ~~~~~~~~~~~~~~~~ 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 or clone the Cow itself + | +LL | let _ = cow.clone(); + | ~~~~~~~~~~~ +LL | let _ = cow.into_owned(); + | ~~~~~~~~~~~~~~~~ error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type --> $DIR/suspicious_to_owned.rs:60:13 |
