1 use pin_project::pin_project;
2 # [pin (__private (project_replace = ProjOwn))]
3 struct Struct<T, U> {
4     #[pin]
5     pinned: T,
6     unpinned: U,
7 }
8 #[allow(box_pointers)]
9 #[allow(deprecated)]
10 #[allow(explicit_outlives_requirements)]
11 #[allow(single_use_lifetimes)]
12 #[allow(unreachable_pub)]
13 #[allow(clippy::unknown_clippy_lints)]
14 #[allow(clippy::pattern_type_mismatch)]
15 #[allow(clippy::redundant_pub_crate)]
16 #[allow(dead_code)]
17 struct ProjOwn<T, U> {
18     pinned: ::pin_project::__private::PhantomData<T>,
19     unpinned: U,
20 }
21 #[allow(box_pointers)]
22 #[allow(deprecated)]
23 #[allow(explicit_outlives_requirements)]
24 #[allow(single_use_lifetimes)]
25 #[allow(unreachable_pub)]
26 #[allow(clippy::unknown_clippy_lints)]
27 #[allow(clippy::pattern_type_mismatch)]
28 #[allow(clippy::redundant_pub_crate)]
29 #[allow(clippy::semicolon_if_nothing_returned)]
30 #[allow(clippy::used_underscore_binding)]
31 const _: () = {
32     #[allow(box_pointers)]
33     #[allow(deprecated)]
34     #[allow(explicit_outlives_requirements)]
35     #[allow(single_use_lifetimes)]
36     #[allow(unreachable_pub)]
37     #[allow(clippy::unknown_clippy_lints)]
38     #[allow(clippy::pattern_type_mismatch)]
39     #[allow(clippy::redundant_pub_crate)]
40     #[allow(dead_code)]
41     #[allow(clippy::mut_mut)]
42     #[allow(clippy::type_repetition_in_bounds)]
43     struct __StructProjection<'pin, T, U>
44     where
45         Struct<T, U>: 'pin,
46     {
47         pinned: ::pin_project::__private::Pin<&'pin mut (T)>,
48         unpinned: &'pin mut (U),
49     }
50     #[allow(box_pointers)]
51     #[allow(deprecated)]
52     #[allow(explicit_outlives_requirements)]
53     #[allow(single_use_lifetimes)]
54     #[allow(unreachable_pub)]
55     #[allow(clippy::unknown_clippy_lints)]
56     #[allow(clippy::pattern_type_mismatch)]
57     #[allow(clippy::redundant_pub_crate)]
58     #[allow(dead_code)]
59     #[allow(clippy::ref_option_ref)]
60     #[allow(clippy::type_repetition_in_bounds)]
61     struct __StructProjectionRef<'pin, T, U>
62     where
63         Struct<T, U>: 'pin,
64     {
65         pinned: ::pin_project::__private::Pin<&'pin (T)>,
66         unpinned: &'pin (U),
67     }
68     impl<T, U> Struct<T, U> {
project<'pin>( self: ::pin_project::__private::Pin<&'pin mut Self>, ) -> __StructProjection<'pin, T, U>69         fn project<'pin>(
70             self: ::pin_project::__private::Pin<&'pin mut Self>,
71         ) -> __StructProjection<'pin, T, U> {
72             unsafe {
73                 let Self { pinned, unpinned } = self.get_unchecked_mut();
74                 __StructProjection {
75                     pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
76                     unpinned,
77                 }
78             }
79         }
80         #[allow(clippy::missing_const_for_fn)]
project_ref<'pin>( self: ::pin_project::__private::Pin<&'pin Self>, ) -> __StructProjectionRef<'pin, T, U>81         fn project_ref<'pin>(
82             self: ::pin_project::__private::Pin<&'pin Self>,
83         ) -> __StructProjectionRef<'pin, T, U> {
84             unsafe {
85                 let Self { pinned, unpinned } = self.get_ref();
86                 __StructProjectionRef {
87                     pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
88                     unpinned,
89                 }
90             }
91         }
project_replace( self: ::pin_project::__private::Pin<&mut Self>, __replacement: Self, ) -> ProjOwn<T, U>92         fn project_replace(
93             self: ::pin_project::__private::Pin<&mut Self>,
94             __replacement: Self,
95         ) -> ProjOwn<T, U> {
96             unsafe {
97                 let __self_ptr: *mut Self = self.get_unchecked_mut();
98                 let __guard = ::pin_project::__private::UnsafeOverwriteGuard {
99                     target: __self_ptr,
100                     value: ::pin_project::__private::ManuallyDrop::new(__replacement),
101                 };
102                 let Self { pinned, unpinned } = &mut *__self_ptr;
103                 let __result = ProjOwn {
104                     pinned: ::pin_project::__private::PhantomData,
105                     unpinned: ::pin_project::__private::ptr::read(unpinned),
106                 };
107                 {
108                     let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(pinned);
109                 }
110                 __result
111             }
112         }
113     }
114     #[forbid(safe_packed_borrows)]
__assert_not_repr_packed<T, U>(this: &Struct<T, U>)115     fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) {
116         let _ = &this.pinned;
117         let _ = &this.unpinned;
118     }
119     #[allow(missing_debug_implementations)]
120     struct __Struct<'pin, T, U> {
121         __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
122             'pin,
123             (
124                 ::pin_project::__private::PhantomData<T>,
125                 ::pin_project::__private::PhantomData<U>,
126             ),
127         >,
128         __field0: T,
129     }
130     impl<'pin, T, U> ::pin_project::__private::Unpin for Struct<T, U> where
131         __Struct<'pin, T, U>: ::pin_project::__private::Unpin
132     {
133     }
134     #[doc(hidden)]
135     unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Struct<T, U> where
136         __Struct<'pin, T, U>: ::pin_project::__private::Unpin
137     {
138     }
139     trait StructMustNotImplDrop {}
140     #[allow(clippy::drop_bounds, drop_bounds)]
141     impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
142     impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
143     #[doc(hidden)]
144     impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> {
drop(self: ::pin_project::__private::Pin<&mut Self>)145         unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
146     }
147 };
main()148 fn main() {}
149