aboutsummaryrefslogtreecommitdiff
path: root/tests/expand/pinned_drop/struct.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/expand/pinned_drop/struct.rs')
-rw-r--r--tests/expand/pinned_drop/struct.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/expand/pinned_drop/struct.rs b/tests/expand/pinned_drop/struct.rs
new file mode 100644
index 0000000..948e6cc
--- /dev/null
+++ b/tests/expand/pinned_drop/struct.rs
@@ -0,0 +1,18 @@
+use pin_project::{pin_project, pinned_drop};
+use std::pin::Pin;
+
+#[pin_project(PinnedDrop)]
+struct Struct<T, U> {
+ #[pin]
+ pinned: T,
+ unpinned: U,
+}
+
+#[pinned_drop]
+impl<T, U> PinnedDrop for Struct<T, U> {
+ fn drop(self: Pin<&mut Self>) {
+ let _ = self;
+ }
+}
+
+fn main() {}