• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use pin_project::{pin_project, pinned_drop};
2 use std::pin::Pin;
3 
4 #[pin_project(PinnedDrop, project = EnumProj, project_ref = EnumProjRef)]
5 enum Enum<T, U> {
6     Struct {
7         #[pin]
8         pinned: T,
9         unpinned: U,
10     },
11     Tuple(#[pin] T, U),
12     Unit,
13 }
14 
15 #[pinned_drop]
16 impl<T, U> PinnedDrop for Enum<T, U> {
drop(self: Pin<&mut Self>)17     fn drop(self: Pin<&mut Self>) {
18         let _ = self;
19     }
20 }
21 
main()22 fn main() {}
23