1 use pin_project::pin_project;
2 #[pin(__private(project = Proj))]
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(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(clippy::mut_mut)]
20 struct Proj<'pin, T, U>
21 where
22 Struct<T, U>: 'pin,
23 {
24 pinned: ::pin_project::__private::Pin<&'pin mut (T)>,
25 unpinned: &'pin mut (U),
26 }
27 #[allow(box_pointers)]
28 #[allow(deprecated)]
29 #[allow(explicit_outlives_requirements)]
30 #[allow(single_use_lifetimes)]
31 #[allow(unreachable_pub)]
32 #[allow(unused_tuple_struct_fields)]
33 #[allow(clippy::unknown_clippy_lints)]
34 #[allow(clippy::pattern_type_mismatch)]
35 #[allow(clippy::redundant_pub_crate)]
36 #[allow(clippy::type_repetition_in_bounds)]
37 #[allow(unused_qualifications)]
38 #[allow(clippy::semicolon_if_nothing_returned)]
39 #[allow(clippy::use_self)]
40 #[allow(clippy::used_underscore_binding)]
41 const _: () = {
42 #[allow(unused_extern_crates)]
43 extern crate pin_project as _pin_project;
44 #[allow(dead_code)]
45 #[allow(clippy::ref_option_ref)]
46 struct __StructProjectionRef<'pin, T, U>
47 where
48 Struct<T, U>: 'pin,
49 {
50 pinned: ::pin_project::__private::Pin<&'pin (T)>,
51 unpinned: &'pin (U),
52 }
53 impl<T, U> Struct<T, U> {
54 #[allow(dead_code)]
project<'pin>( self: _pin_project::__private::Pin<&'pin mut Self>, ) -> Proj<'pin, T, U>55 fn project<'pin>(
56 self: _pin_project::__private::Pin<&'pin mut Self>,
57 ) -> Proj<'pin, T, U> {
58 unsafe {
59 let Self { pinned, unpinned } = self.get_unchecked_mut();
60 Proj {
61 pinned: _pin_project::__private::Pin::new_unchecked(pinned),
62 unpinned,
63 }
64 }
65 }
66 #[allow(dead_code)]
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(unaligned_references, 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>
97 where
98 __Struct<'pin, T, U>: _pin_project::__private::Unpin,
99 {}
100 #[doc(hidden)]
101 unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Struct<T, U>
102 where
103 __Struct<'pin, T, U>: _pin_project::__private::Unpin,
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