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