summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/clone_on_copy_impl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/clone_on_copy_impl.rs')
-rw-r--r--src/tools/clippy/tests/ui/clone_on_copy_impl.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/clone_on_copy_impl.rs b/src/tools/clippy/tests/ui/clone_on_copy_impl.rs
new file mode 100644
index 000000000..8f9f2a0db
--- /dev/null
+++ b/src/tools/clippy/tests/ui/clone_on_copy_impl.rs
@@ -0,0 +1,22 @@
+use std::fmt;
+use std::marker::PhantomData;
+
+pub struct Key<T> {
+ #[doc(hidden)]
+ pub __name: &'static str,
+ #[doc(hidden)]
+ pub __phantom: PhantomData<T>,
+}
+
+impl<T> Copy for Key<T> {}
+
+impl<T> Clone for Key<T> {
+ fn clone(&self) -> Self {
+ Key {
+ __name: self.__name,
+ __phantom: self.__phantom,
+ }
+ }
+}
+
+fn main() {}