summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-25700.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/issues/issue-25700.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-25700.rs b/src/test/ui/issues/issue-25700.rs
new file mode 100644
index 000000000..e5b9a9752
--- /dev/null
+++ b/src/test/ui/issues/issue-25700.rs
@@ -0,0 +1,14 @@
+struct S<T: 'static>(#[allow(unused_tuple_struct_fields)] Option<&'static T>);
+
+trait Tr { type Out; }
+impl<T> Tr for T { type Out = T; }
+
+impl<T: 'static> Copy for S<T> where S<T>: Tr<Out=T> {}
+impl<T: 'static> Clone for S<T> where S<T>: Tr<Out=T> {
+ fn clone(&self) -> Self { *self }
+}
+fn main() {
+ let t = S::<()>(None);
+ drop(t);
+ drop(t); //~ ERROR use of moved value
+}