]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/wrong_self_convention.rs
Auto merge of #84620 - Dylan-DPC:rollup-wkv97im, r=Dylan-DPC
[rust.git] / src / tools / clippy / tests / ui / wrong_self_convention.rs
index 6cfc0fcb4cae45edcd4f970215fa73898050358d..cdfbdb8b0db3e54c263b0033091ec363be665b35 100644 (file)
@@ -163,3 +163,30 @@ trait C: Copy {
         fn to_mut(&mut self);
     }
 }
+
+mod issue6727 {
+    #[derive(Clone, Copy)]
+    struct FooCopy;
+
+    impl FooCopy {
+        fn to_u64(self) -> u64 {
+            1
+        }
+        // trigger lint
+        fn to_u64_v2(&self) -> u64 {
+            1
+        }
+    }
+
+    struct FooNoCopy;
+
+    impl FooNoCopy {
+        // trigger lint
+        fn to_u64(self) -> u64 {
+            2
+        }
+        fn to_u64_v2(&self) -> u64 {
+            2
+        }
+    }
+}