• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use pin_project::pin_project;
2 #[pin(__private(project_replace = EnumProjOwn))]
3 enum Enum<T, U> {
4     Struct { #[pin] pinned: T, unpinned: U },
5     Tuple(#[pin] T, U),
6     Unit,
7 }
8 #[allow(box_pointers)]
9 #[allow(deprecated)]
10 #[allow(explicit_outlives_requirements)]
11 #[allow(single_use_lifetimes)]
12 #[allow(unreachable_pub)]
13 #[allow(unused_tuple_struct_fields)]
14 #[allow(clippy::unknown_clippy_lints)]
15 #[allow(clippy::pattern_type_mismatch)]
16 #[allow(clippy::redundant_pub_crate)]
17 #[allow(clippy::type_repetition_in_bounds)]
18 #[allow(dead_code)]
19 #[allow(variant_size_differences)]
20 #[allow(clippy::large_enum_variant)]
21 enum EnumProjOwn<T, U> {
22     Struct { pinned: ::pin_project::__private::PhantomData<T>, unpinned: U },
23     Tuple(::pin_project::__private::PhantomData<T>, U),
24     Unit,
25 }
26 #[allow(box_pointers)]
27 #[allow(deprecated)]
28 #[allow(explicit_outlives_requirements)]
29 #[allow(single_use_lifetimes)]
30 #[allow(unreachable_pub)]
31 #[allow(unused_tuple_struct_fields)]
32 #[allow(clippy::unknown_clippy_lints)]
33 #[allow(clippy::pattern_type_mismatch)]
34 #[allow(clippy::redundant_pub_crate)]
35 #[allow(clippy::type_repetition_in_bounds)]
36 #[allow(unused_qualifications)]
37 #[allow(clippy::semicolon_if_nothing_returned)]
38 #[allow(clippy::use_self)]
39 #[allow(clippy::used_underscore_binding)]
40 const _: () = {
41     #[allow(unused_extern_crates)]
42     extern crate pin_project as _pin_project;
43     impl<T, U> Enum<T, U> {
44         #[allow(dead_code)]
project_replace( self: _pin_project::__private::Pin<&mut Self>, __replacement: Self, ) -> EnumProjOwn<T, U>45         fn project_replace(
46             self: _pin_project::__private::Pin<&mut Self>,
47             __replacement: Self,
48         ) -> EnumProjOwn<T, U> {
49             unsafe {
50                 let __self_ptr: *mut Self = self.get_unchecked_mut();
51                 let __guard = _pin_project::__private::UnsafeOverwriteGuard::new(
52                     __self_ptr,
53                     __replacement,
54                 );
55                 match &mut *__self_ptr {
56                     Self::Struct { pinned, unpinned } => {
57                         let __result = EnumProjOwn::Struct {
58                             pinned: _pin_project::__private::PhantomData,
59                             unpinned: _pin_project::__private::ptr::read(unpinned),
60                         };
61                         {
62                             let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(
63                                 pinned,
64                             );
65                         }
66                         __result
67                     }
68                     Self::Tuple(_0, _1) => {
69                         let __result = EnumProjOwn::Tuple(
70                             _pin_project::__private::PhantomData,
71                             _pin_project::__private::ptr::read(_1),
72                         );
73                         {
74                             let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(
75                                 _0,
76                             );
77                         }
78                         __result
79                     }
80                     Self::Unit => {
81                         let __result = EnumProjOwn::Unit;
82                         {}
83                         __result
84                     }
85                 }
86             }
87         }
88     }
89     #[allow(missing_debug_implementations)]
90     struct __Enum<'pin, T, U> {
91         __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
92             'pin,
93             (
94                 _pin_project::__private::PhantomData<T>,
95                 _pin_project::__private::PhantomData<U>,
96             ),
97         >,
98         __field0: T,
99         __field1: T,
100     }
101     impl<'pin, T, U> _pin_project::__private::Unpin for Enum<T, U>
102     where
103         __Enum<'pin, T, U>: _pin_project::__private::Unpin,
104     {}
105     #[doc(hidden)]
106     unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Enum<T, U>
107     where
108         __Enum<'pin, T, U>: _pin_project::__private::Unpin,
109     {}
110     trait EnumMustNotImplDrop {}
111     #[allow(clippy::drop_bounds, drop_bounds)]
112     impl<T: _pin_project::__private::Drop> EnumMustNotImplDrop for T {}
113     impl<T, U> EnumMustNotImplDrop for Enum<T, U> {}
114     #[doc(hidden)]
115     impl<T, U> _pin_project::__private::PinnedDrop for Enum<T, U> {
drop(self: _pin_project::__private::Pin<&mut Self>)116         unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
117     }
118 };
main()119 fn main() {}
120