]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/implicit_clone.fixed
Rollup merge of #105419 - YC:issue-41731, r=petrochenkov
[rust.git] / src / tools / clippy / tests / ui / implicit_clone.fixed
index 33770fc2a2cf9cca67a956157de5fc83599d93d2..51b1afbe5ac83ecaffe7bcca428f1ed8b08fa2bc 100644 (file)
@@ -115,4 +115,14 @@ fn main() {
     let pathbuf_ref = &pathbuf_ref;
     let _ = pathbuf_ref.to_owned(); // Don't lint. Returns `&&PathBuf`
     let _ = (**pathbuf_ref).clone();
+
+    struct NoClone;
+    impl ToOwned for NoClone {
+        type Owned = Self;
+        fn to_owned(&self) -> Self {
+            NoClone
+        }
+    }
+    let no_clone = &NoClone;
+    let _ = no_clone.to_owned();
 }