diff options
Diffstat (limited to 'examples/pinned_drop-expanded.rs')
-rw-r--r-- | examples/pinned_drop-expanded.rs | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/examples/pinned_drop-expanded.rs b/examples/pinned_drop-expanded.rs index 15dde89..8f295e9 100644 --- a/examples/pinned_drop-expanded.rs +++ b/examples/pinned_drop-expanded.rs @@ -34,61 +34,64 @@ pub struct Struct<'a, T> { } #[doc(hidden)] -#[allow(clippy::mut_mut)] // This lint warns `&mut &mut <ty>`. -#[allow(dead_code)] // This lint warns unused fields/variants. +#[allow(dead_code)] #[allow(single_use_lifetimes)] +#[allow(clippy::mut_mut)] +#[allow(clippy::type_repetition_in_bounds)] pub(crate) struct __StructProjection<'pin, 'a, T> where Struct<'a, T>: 'pin, { was_dropped: &'pin mut (&'a mut bool), - field: ::pin_project::__reexport::pin::Pin<&'pin mut (T)>, + field: ::pin_project::__private::Pin<&'pin mut (T)>, } #[doc(hidden)] -#[allow(dead_code)] // This lint warns unused fields/variants. +#[allow(dead_code)] #[allow(single_use_lifetimes)] +#[allow(clippy::type_repetition_in_bounds)] pub(crate) struct __StructProjectionRef<'pin, 'a, T> where Struct<'a, T>: 'pin, { was_dropped: &'pin (&'a mut bool), - field: ::pin_project::__reexport::pin::Pin<&'pin (T)>, + field: ::pin_project::__private::Pin<&'pin (T)>, } #[doc(hidden)] #[allow(non_upper_case_globals)] #[allow(single_use_lifetimes)] -const __SCOPE_Struct: () = { +#[allow(clippy::used_underscore_binding)] +const _: () = { impl<'a, T> Struct<'a, T> { pub(crate) fn project<'pin>( - self: ::pin_project::__reexport::pin::Pin<&'pin mut Self>, + self: ::pin_project::__private::Pin<&'pin mut Self>, ) -> __StructProjection<'pin, 'a, T> { unsafe { let Self { was_dropped, field } = self.get_unchecked_mut(); __StructProjection { was_dropped, - field: ::pin_project::__reexport::pin::Pin::new_unchecked(field), + field: ::pin_project::__private::Pin::new_unchecked(field), } } } pub(crate) fn project_ref<'pin>( - self: ::pin_project::__reexport::pin::Pin<&'pin Self>, + self: ::pin_project::__private::Pin<&'pin Self>, ) -> __StructProjectionRef<'pin, 'a, T> { unsafe { let Self { was_dropped, field } = self.get_ref(); __StructProjectionRef { was_dropped, - field: ::pin_project::__reexport::pin::Pin::new_unchecked(field), + field: ::pin_project::__private::Pin::new_unchecked(field), } } } } - impl<'a, T> ::pin_project::__reexport::ops::Drop for Struct<'a, T> { + impl<'a, T> ::pin_project::__private::Drop for Struct<'a, T> { fn drop(&mut self) { // Safety - we're in 'drop', so we know that 'self' will // never move again. - let pinned_self = unsafe { ::pin_project::__reexport::pin::Pin::new_unchecked(self) }; + let pinned_self = unsafe { ::pin_project::__private::Pin::new_unchecked(self) }; // We call `pinned_drop` only once. Since `PinnedDrop::drop` // is an unsafe method and a private API, it is never called again in safe // code *unless the user uses a maliciously crafted macro*. @@ -107,13 +110,14 @@ const __SCOPE_Struct: () = { __field0: T, __lifetime0: &'a (), } - impl<'pin, 'a, T> ::pin_project::__reexport::marker::Unpin for Struct<'a, T> where - __Struct<'pin, 'a, T>: ::pin_project::__reexport::marker::Unpin + impl<'pin, 'a, T> ::pin_project::__private::Unpin for Struct<'a, T> where + __Struct<'pin, 'a, T>: ::pin_project::__private::Unpin { } unsafe impl<'a, T> ::pin_project::UnsafeUnpin for Struct<'a, T> {} - // Ensure that it's impossible to use pin projections on a #[repr(packed)] struct. + // Ensure that it's impossible to use pin projections on a #[repr(packed)] + // struct. // // See ./struct-default-expanded.rs and https://github.com/taiki-e/pin-project/pull/34 // for details. |