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