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