1 use pin_project::pin_project;
2 # [pin (__private (project_ref = ProjRef))]
3 enum Enum<T, U> {
4 Struct {
5 #[pin]
6 pinned: T,
7 unpinned: U,
8 },
9 Tuple(#[pin] T, U),
10 Unit,
11 }
12 #[allow(box_pointers)]
13 #[allow(deprecated)]
14 #[allow(explicit_outlives_requirements)]
15 #[allow(single_use_lifetimes)]
16 #[allow(unreachable_pub)]
17 #[allow(clippy::unknown_clippy_lints)]
18 #[allow(clippy::pattern_type_mismatch)]
19 #[allow(clippy::redundant_pub_crate)]
20 #[allow(dead_code)]
21 #[allow(clippy::ref_option_ref)]
22 #[allow(clippy::type_repetition_in_bounds)]
23 enum ProjRef<'pin, T, U>
24 where
25 Enum<T, U>: 'pin,
26 {
27 Struct {
28 pinned: ::pin_project::__private::Pin<&'pin (T)>,
29 unpinned: &'pin (U),
30 },
31 Tuple(::pin_project::__private::Pin<&'pin (T)>, &'pin (U)),
32 Unit,
33 }
34 #[allow(box_pointers)]
35 #[allow(deprecated)]
36 #[allow(explicit_outlives_requirements)]
37 #[allow(single_use_lifetimes)]
38 #[allow(unreachable_pub)]
39 #[allow(clippy::unknown_clippy_lints)]
40 #[allow(clippy::pattern_type_mismatch)]
41 #[allow(clippy::redundant_pub_crate)]
42 #[allow(clippy::semicolon_if_nothing_returned)]
43 #[allow(clippy::used_underscore_binding)]
44 const _: () = {
45 impl<T, U> Enum<T, U> {
46 #[allow(clippy::missing_const_for_fn)]
project_ref<'pin>( self: ::pin_project::__private::Pin<&'pin Self>, ) -> ProjRef<'pin, T, U>47 fn project_ref<'pin>(
48 self: ::pin_project::__private::Pin<&'pin Self>,
49 ) -> ProjRef<'pin, T, U> {
50 unsafe {
51 match self.get_ref() {
52 Self::Struct { pinned, unpinned } => ProjRef::Struct {
53 pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
54 unpinned,
55 },
56 Self::Tuple(_0, _1) => {
57 ProjRef::Tuple(::pin_project::__private::Pin::new_unchecked(_0), _1)
58 }
59 Self::Unit => ProjRef::Unit,
60 }
61 }
62 }
63 }
64 #[allow(missing_debug_implementations)]
65 struct __Enum<'pin, T, U> {
66 __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
67 'pin,
68 (
69 ::pin_project::__private::PhantomData<T>,
70 ::pin_project::__private::PhantomData<U>,
71 ),
72 >,
73 __field0: T,
74 __field1: T,
75 }
76 impl<'pin, T, U> ::pin_project::__private::Unpin for Enum<T, U> where
77 __Enum<'pin, T, U>: ::pin_project::__private::Unpin
78 {
79 }
80 #[doc(hidden)]
81 unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Enum<T, U> where
82 __Enum<'pin, T, U>: ::pin_project::__private::Unpin
83 {
84 }
85 trait EnumMustNotImplDrop {}
86 #[allow(clippy::drop_bounds, drop_bounds)]
87 impl<T: ::pin_project::__private::Drop> EnumMustNotImplDrop for T {}
88 impl<T, U> EnumMustNotImplDrop for Enum<T, U> {}
89 #[doc(hidden)]
90 impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> {
drop(self: ::pin_project::__private::Pin<&mut Self>)91 unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
92 }
93 };
main()94 fn main() {}
95