summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/implicit_clone.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/tools/clippy/tests/ui/implicit_clone.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/tools/clippy/tests/ui/implicit_clone.stderr76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/implicit_clone.stderr b/src/tools/clippy/tests/ui/implicit_clone.stderr
new file mode 100644
index 000000000..92c1aa58a
--- /dev/null
+++ b/src/tools/clippy/tests/ui/implicit_clone.stderr
@@ -0,0 +1,76 @@
+error: implicitly cloning a `Vec` by calling `to_owned` on its dereferenced type
+ --> $DIR/implicit_clone.rs:66:13
+ |
+LL | let _ = vec.to_owned();
+ | ^^^^^^^^^^^^^^ help: consider using: `vec.clone()`
+ |
+ = note: `-D clippy::implicit-clone` implied by `-D warnings`
+
+error: implicitly cloning a `Vec` by calling `to_vec` on its dereferenced type
+ --> $DIR/implicit_clone.rs:67:13
+ |
+LL | let _ = vec.to_vec();
+ | ^^^^^^^^^^^^ help: consider using: `vec.clone()`
+
+error: implicitly cloning a `Vec` by calling `to_owned` on its dereferenced type
+ --> $DIR/implicit_clone.rs:71:13
+ |
+LL | let _ = vec_ref.to_owned();
+ | ^^^^^^^^^^^^^^^^^^ help: consider using: `vec_ref.clone()`
+
+error: implicitly cloning a `Vec` by calling `to_vec` on its dereferenced type
+ --> $DIR/implicit_clone.rs:72:13
+ |
+LL | let _ = vec_ref.to_vec();
+ | ^^^^^^^^^^^^^^^^ help: consider using: `vec_ref.clone()`
+
+error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
+ --> $DIR/implicit_clone.rs:84:13
+ |
+LL | let _ = str.to_owned();
+ | ^^^^^^^^^^^^^^ help: consider using: `str.clone()`
+
+error: implicitly cloning a `Kitten` by calling `to_owned` on its dereferenced type
+ --> $DIR/implicit_clone.rs:88:13
+ |
+LL | let _ = kitten.to_owned();
+ | ^^^^^^^^^^^^^^^^^ help: consider using: `kitten.clone()`
+
+error: implicitly cloning a `PathBuf` by calling `to_owned` on its dereferenced type
+ --> $DIR/implicit_clone.rs:98:13
+ |
+LL | let _ = pathbuf.to_owned();
+ | ^^^^^^^^^^^^^^^^^^ help: consider using: `pathbuf.clone()`
+
+error: implicitly cloning a `PathBuf` by calling `to_path_buf` on its dereferenced type
+ --> $DIR/implicit_clone.rs:99:13
+ |
+LL | let _ = pathbuf.to_path_buf();
+ | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `pathbuf.clone()`
+
+error: implicitly cloning a `OsString` by calling `to_owned` on its dereferenced type
+ --> $DIR/implicit_clone.rs:102:13
+ |
+LL | let _ = os_string.to_owned();
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `os_string.clone()`
+
+error: implicitly cloning a `OsString` by calling `to_os_string` on its dereferenced type
+ --> $DIR/implicit_clone.rs:103:13
+ |
+LL | let _ = os_string.to_os_string();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `os_string.clone()`
+
+error: implicitly cloning a `PathBuf` by calling `to_path_buf` on its dereferenced type
+ --> $DIR/implicit_clone.rs:114:13
+ |
+LL | let _ = pathbuf_ref.to_path_buf();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(*pathbuf_ref).clone()`
+
+error: implicitly cloning a `PathBuf` by calling `to_path_buf` on its dereferenced type
+ --> $DIR/implicit_clone.rs:117:13
+ |
+LL | let _ = pathbuf_ref.to_path_buf();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(**pathbuf_ref).clone()`
+
+error: aborting due to 12 previous errors
+