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