diff options
Diffstat (limited to 'tests/expand/pinned_drop/enum.rs')
-rw-r--r-- | tests/expand/pinned_drop/enum.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/expand/pinned_drop/enum.rs b/tests/expand/pinned_drop/enum.rs new file mode 100644 index 0000000..f5b8aa4 --- /dev/null +++ b/tests/expand/pinned_drop/enum.rs @@ -0,0 +1,22 @@ +use pin_project::{pin_project, pinned_drop}; +use std::pin::Pin; + +#[pin_project(PinnedDrop, project = EnumProj, project_ref = EnumProjRef)] +enum Enum<T, U> { + Struct { + #[pin] + pinned: T, + unpinned: U, + }, + Tuple(#[pin] T, U), + Unit, +} + +#[pinned_drop] +impl<T, U> PinnedDrop for Enum<T, U> { + fn drop(self: Pin<&mut Self>) { + let _ = self; + } +} + +fn main() {} |