1 use pin_project::pin_project;
2 # [pin (__private (project_replace = ProjOwn))]
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(variant_size_differences)]
22 #[allow(clippy::large_enum_variant)]
23 enum ProjOwn<T, U> {
24 Struct {
25 pinned: ::pin_project::__private::PhantomData<T>,
26 unpinned: U,
27 },
28 Tuple(::pin_project::__private::PhantomData<T>, U),
29 Unit,
30 }
31 #[allow(box_pointers)]
32 #[allow(deprecated)]
33 #[allow(explicit_outlives_requirements)]
34 #[allow(single_use_lifetimes)]
35 #[allow(unreachable_pub)]
36 #[allow(clippy::unknown_clippy_lints)]
37 #[allow(clippy::pattern_type_mismatch)]
38 #[allow(clippy::redundant_pub_crate)]
39 #[allow(clippy::semicolon_if_nothing_returned)]
40 #[allow(clippy::used_underscore_binding)]
41 const _: () = {
42 impl<T, U> Enum<T, U> {
project_replace( self: ::pin_project::__private::Pin<&mut Self>, __replacement: Self, ) -> ProjOwn<T, U>43 fn project_replace(
44 self: ::pin_project::__private::Pin<&mut Self>,
45 __replacement: Self,
46 ) -> ProjOwn<T, U> {
47 unsafe {
48 let __self_ptr: *mut Self = self.get_unchecked_mut();
49 let __guard = ::pin_project::__private::UnsafeOverwriteGuard {
50 target: __self_ptr,
51 value: ::pin_project::__private::ManuallyDrop::new(__replacement),
52 };
53 match &mut *__self_ptr {
54 Self::Struct { pinned, unpinned } => {
55 let __result = ProjOwn::Struct {
56 pinned: ::pin_project::__private::PhantomData,
57 unpinned: ::pin_project::__private::ptr::read(unpinned),
58 };
59 {
60 let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(pinned);
61 }
62 __result
63 }
64 Self::Tuple(_0, _1) => {
65 let __result = ProjOwn::Tuple(
66 ::pin_project::__private::PhantomData,
67 ::pin_project::__private::ptr::read(_1),
68 );
69 {
70 let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(_0);
71 }
72 __result
73 }
74 Self::Unit => {
75 let __result = ProjOwn::Unit;
76 {}
77 __result
78 }
79 }
80 }
81 }
82 }
83 #[allow(missing_debug_implementations)]
84 struct __Enum<'pin, T, U> {
85 __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
86 'pin,
87 (
88 ::pin_project::__private::PhantomData<T>,
89 ::pin_project::__private::PhantomData<U>,
90 ),
91 >,
92 __field0: T,
93 __field1: T,
94 }
95 impl<'pin, T, U> ::pin_project::__private::Unpin for Enum<T, U> where
96 __Enum<'pin, T, U>: ::pin_project::__private::Unpin
97 {
98 }
99 #[doc(hidden)]
100 unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Enum<T, U> where
101 __Enum<'pin, T, U>: ::pin_project::__private::Unpin
102 {
103 }
104 trait EnumMustNotImplDrop {}
105 #[allow(clippy::drop_bounds, drop_bounds)]
106 impl<T: ::pin_project::__private::Drop> EnumMustNotImplDrop for T {}
107 impl<T, U> EnumMustNotImplDrop for Enum<T, U> {}
108 #[doc(hidden)]
109 impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> {
drop(self: ::pin_project::__private::Pin<&mut Self>)110 unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
111 }
112 };
main()113 fn main() {}
114