From dc0db358abe19481e475e10c32149b53370f1a1c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:57:31 +0200 Subject: Merging upstream version 1.72.1+dfsg1. Signed-off-by: Daniel Baumann --- .../tests/expand/pinned_drop/enum.expanded.rs | 45 ++++++++++++++-------- .../tests/expand/pinned_drop/enum.rs | 3 +- .../tests/expand/pinned_drop/struct.expanded.rs | 21 ++++++---- .../tests/expand/pinned_drop/struct.rs | 3 +- 4 files changed, 46 insertions(+), 26 deletions(-) (limited to 'vendor/pin-project-lite/tests/expand/pinned_drop') diff --git a/vendor/pin-project-lite/tests/expand/pinned_drop/enum.expanded.rs b/vendor/pin-project-lite/tests/expand/pinned_drop/enum.expanded.rs index 665ff6338..838707dc5 100644 --- a/vendor/pin-project-lite/tests/expand/pinned_drop/enum.expanded.rs +++ b/vendor/pin-project-lite/tests/expand/pinned_drop/enum.expanded.rs @@ -1,5 +1,5 @@ -use pin_project_lite::pin_project; use std::pin::Pin; +use pin_project_lite::pin_project; enum Enum { Struct { pinned: T, unpinned: U }, Unit, @@ -43,28 +43,38 @@ where #[allow(clippy::used_underscore_binding)] const _: () = { impl Enum { + #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, ) -> EnumProj<'__pin, T, U> { unsafe { match self.get_unchecked_mut() { - Self::Struct { pinned, unpinned } => EnumProj::Struct { - pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), - unpinned: unpinned, - }, + Self::Struct { pinned, unpinned } => { + EnumProj::Struct { + pinned: ::pin_project_lite::__private::Pin::new_unchecked( + pinned, + ), + unpinned: unpinned, + } + } Self::Unit => EnumProj::Unit, } } } + #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, ) -> EnumProjRef<'__pin, T, U> { unsafe { match self.get_ref() { - Self::Struct { pinned, unpinned } => EnumProjRef::Struct { - pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), - unpinned: unpinned, - }, + Self::Struct { pinned, unpinned } => { + EnumProjRef::Struct { + pinned: ::pin_project_lite::__private::Pin::new_unchecked( + pinned, + ), + unpinned: unpinned, + } + } Self::Unit => EnumProjRef::Unit, } } @@ -76,18 +86,21 @@ const _: () = { Struct: (T, ::pin_project_lite::__private::AlwaysUnpin), Unit: (), } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} impl ::pin_project_lite::__private::Drop for Enum { fn drop(&mut self) { - fn __drop_inner(this: ::pin_project_lite::__private::Pin<&mut Enum>) { + fn __drop_inner( + this: ::pin_project_lite::__private::Pin<&mut Enum>, + ) { fn __drop_inner() {} let _ = this; } - let pinned_self: ::pin_project_lite::__private::Pin<&mut Self> = - unsafe { ::pin_project_lite::__private::Pin::new_unchecked(self) }; + let pinned_self: ::pin_project_lite::__private::Pin<&mut Self> = unsafe { + ::pin_project_lite::__private::Pin::new_unchecked(self) + }; __drop_inner(pinned_self); } } diff --git a/vendor/pin-project-lite/tests/expand/pinned_drop/enum.rs b/vendor/pin-project-lite/tests/expand/pinned_drop/enum.rs index 1855cb7a1..5f3508c0e 100644 --- a/vendor/pin-project-lite/tests/expand/pinned_drop/enum.rs +++ b/vendor/pin-project-lite/tests/expand/pinned_drop/enum.rs @@ -1,6 +1,7 @@ -use pin_project_lite::pin_project; use std::pin::Pin; +use pin_project_lite::pin_project; + pin_project! { #[project = EnumProj] #[project_ref = EnumProjRef] diff --git a/vendor/pin-project-lite/tests/expand/pinned_drop/struct.expanded.rs b/vendor/pin-project-lite/tests/expand/pinned_drop/struct.expanded.rs index 5b82b7a19..567fefa8c 100644 --- a/vendor/pin-project-lite/tests/expand/pinned_drop/struct.expanded.rs +++ b/vendor/pin-project-lite/tests/expand/pinned_drop/struct.expanded.rs @@ -1,5 +1,5 @@ -use pin_project_lite::pin_project; use std::pin::Pin; +use pin_project_lite::pin_project; struct Struct { pinned: T, unpinned: U, @@ -39,6 +39,7 @@ const _: () = { unpinned: &'__pin (U), } impl Struct { + #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, ) -> Projection<'__pin, T, U> { @@ -50,6 +51,7 @@ const _: () = { } } } + #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, ) -> ProjectionRef<'__pin, T, U> { @@ -68,18 +70,21 @@ const _: () = { pinned: T, unpinned: ::pin_project_lite::__private::AlwaysUnpin, } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} impl ::pin_project_lite::__private::Drop for Struct { fn drop(&mut self) { - fn __drop_inner(this: ::pin_project_lite::__private::Pin<&mut Struct>) { + fn __drop_inner( + this: ::pin_project_lite::__private::Pin<&mut Struct>, + ) { fn __drop_inner() {} let _ = this; } - let pinned_self: ::pin_project_lite::__private::Pin<&mut Self> = - unsafe { ::pin_project_lite::__private::Pin::new_unchecked(self) }; + let pinned_self: ::pin_project_lite::__private::Pin<&mut Self> = unsafe { + ::pin_project_lite::__private::Pin::new_unchecked(self) + }; __drop_inner(pinned_self); } } diff --git a/vendor/pin-project-lite/tests/expand/pinned_drop/struct.rs b/vendor/pin-project-lite/tests/expand/pinned_drop/struct.rs index 0cc756769..5400ecbbd 100644 --- a/vendor/pin-project-lite/tests/expand/pinned_drop/struct.rs +++ b/vendor/pin-project-lite/tests/expand/pinned_drop/struct.rs @@ -1,6 +1,7 @@ -use pin_project_lite::pin_project; use std::pin::Pin; +use pin_project_lite::pin_project; + pin_project! { struct Struct { #[pin] -- cgit v1.2.3