summaryrefslogtreecommitdiffstats
path: root/src/test/ui/exclusive-drop-and-copy.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/exclusive-drop-and-copy.rs')
-rw-r--r--src/test/ui/exclusive-drop-and-copy.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/exclusive-drop-and-copy.rs b/src/test/ui/exclusive-drop-and-copy.rs
new file mode 100644
index 000000000..7a251671e
--- /dev/null
+++ b/src/test/ui/exclusive-drop-and-copy.rs
@@ -0,0 +1,17 @@
+// issue #20126
+
+#[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented
+struct Foo;
+
+impl Drop for Foo {
+ fn drop(&mut self) {}
+}
+
+#[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented
+struct Bar<T>(::std::marker::PhantomData<T>);
+
+impl<T> Drop for Bar<T> {
+ fn drop(&mut self) {}
+}
+
+fn main() {}