diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:26:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:26:03 +0000 |
commit | 9918693037dce8aa4bb6f08741b6812923486c18 (patch) | |
tree | 21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /vendor/pin-project-lite/tests | |
parent | Releasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff) | |
download | rustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip |
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/pin-project-lite/tests')
24 files changed, 390 insertions, 2 deletions
diff --git a/vendor/pin-project-lite/tests/expand/default/enum.expanded.rs b/vendor/pin-project-lite/tests/expand/default/enum.expanded.rs index 09e869144..456b8cc1b 100644 --- a/vendor/pin-project-lite/tests/expand/default/enum.expanded.rs +++ b/vendor/pin-project-lite/tests/expand/default/enum.expanded.rs @@ -3,6 +3,7 @@ enum Enum<T, U> { Struct { pinned: T, unpinned: U }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -20,6 +21,7 @@ where }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -37,6 +39,7 @@ where }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::mut_mut)] @@ -51,6 +54,7 @@ enum EnumProjReplace<T, U> { #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { + #[doc(hidden)] #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, @@ -69,6 +73,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, @@ -87,6 +92,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] fn project_replace( self: ::pin_project_lite::__private::Pin<&mut Self>, diff --git a/vendor/pin-project-lite/tests/expand/default/struct.expanded.rs b/vendor/pin-project-lite/tests/expand/default/struct.expanded.rs index fc10dd718..a9792e1f6 100644 --- a/vendor/pin-project-lite/tests/expand/default/struct.expanded.rs +++ b/vendor/pin-project-lite/tests/expand/default/struct.expanded.rs @@ -9,6 +9,7 @@ struct Struct<T, U> { #[allow(clippy::redundant_pub_crate)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -23,6 +24,7 @@ const _: () = { pinned: ::pin_project_lite::__private::Pin<&'__pin mut (T)>, unpinned: &'__pin mut (U), } + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -38,6 +40,7 @@ const _: () = { unpinned: &'__pin (U), } impl<T, U> Struct<T, U> { + #[doc(hidden)] #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, @@ -50,6 +53,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, diff --git a/vendor/pin-project-lite/tests/expand/multifields/enum.expanded.rs b/vendor/pin-project-lite/tests/expand/multifields/enum.expanded.rs index f6bf9dcdd..f722a1420 100644 --- a/vendor/pin-project-lite/tests/expand/multifields/enum.expanded.rs +++ b/vendor/pin-project-lite/tests/expand/multifields/enum.expanded.rs @@ -3,6 +3,7 @@ enum Enum<T, U> { Struct { pinned1: T, pinned2: T, unpinned1: U, unpinned2: U }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::mut_mut)] @@ -22,6 +23,7 @@ enum EnumProjReplace<T, U> { #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { + #[doc(hidden)] #[inline] fn project_replace( self: ::pin_project_lite::__private::Pin<&mut Self>, diff --git a/vendor/pin-project-lite/tests/expand/multifields/struct.expanded.rs b/vendor/pin-project-lite/tests/expand/multifields/struct.expanded.rs index fdf6edfa4..83ebefe90 100644 --- a/vendor/pin-project-lite/tests/expand/multifields/struct.expanded.rs +++ b/vendor/pin-project-lite/tests/expand/multifields/struct.expanded.rs @@ -5,6 +5,7 @@ struct Struct<T, U> { unpinned1: U, unpinned2: U, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::mut_mut)] @@ -22,6 +23,7 @@ struct StructProjReplace<T, U> { #[allow(clippy::redundant_pub_crate)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -38,6 +40,7 @@ const _: () = { unpinned1: &'__pin mut (U), unpinned2: &'__pin mut (U), } + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -55,6 +58,7 @@ const _: () = { unpinned2: &'__pin (U), } impl<T, U> Struct<T, U> { + #[doc(hidden)] #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, @@ -70,6 +74,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, @@ -84,6 +89,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] fn project_replace( self: ::pin_project_lite::__private::Pin<&mut Self>, diff --git a/vendor/pin-project-lite/tests/expand/naming/enum-all.expanded.rs b/vendor/pin-project-lite/tests/expand/naming/enum-all.expanded.rs index 09e869144..456b8cc1b 100644 --- a/vendor/pin-project-lite/tests/expand/naming/enum-all.expanded.rs +++ b/vendor/pin-project-lite/tests/expand/naming/enum-all.expanded.rs @@ -3,6 +3,7 @@ enum Enum<T, U> { Struct { pinned: T, unpinned: U }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -20,6 +21,7 @@ where }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -37,6 +39,7 @@ where }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::mut_mut)] @@ -51,6 +54,7 @@ enum EnumProjReplace<T, U> { #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { + #[doc(hidden)] #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, @@ -69,6 +73,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, @@ -87,6 +92,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] fn project_replace( self: ::pin_project_lite::__private::Pin<&mut Self>, diff --git a/vendor/pin-project-lite/tests/expand/naming/enum-mut.expanded.rs b/vendor/pin-project-lite/tests/expand/naming/enum-mut.expanded.rs index 79c9050e6..342588cf6 100644 --- a/vendor/pin-project-lite/tests/expand/naming/enum-mut.expanded.rs +++ b/vendor/pin-project-lite/tests/expand/naming/enum-mut.expanded.rs @@ -3,6 +3,7 @@ enum Enum<T, U> { Struct { pinned: T, unpinned: U }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -25,6 +26,7 @@ where #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { + #[doc(hidden)] #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, diff --git a/vendor/pin-project-lite/tests/expand/naming/enum-ref.expanded.rs b/vendor/pin-project-lite/tests/expand/naming/enum-ref.expanded.rs index fa155d9b5..5270e1290 100644 --- a/vendor/pin-project-lite/tests/expand/naming/enum-ref.expanded.rs +++ b/vendor/pin-project-lite/tests/expand/naming/enum-ref.expanded.rs @@ -3,6 +3,7 @@ enum Enum<T, U> { Struct { pinned: T, unpinned: U }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -25,6 +26,7 @@ where #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { + #[doc(hidden)] #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, diff --git a/vendor/pin-project-lite/tests/expand/naming/struct-all.expanded.rs b/vendor/pin-project-lite/tests/expand/naming/struct-all.expanded.rs index dfea76248..13c4079f2 100644 --- a/vendor/pin-project-lite/tests/expand/naming/struct-all.expanded.rs +++ b/vendor/pin-project-lite/tests/expand/naming/struct-all.expanded.rs @@ -3,6 +3,7 @@ struct Struct<T, U> { pinned: T, unpinned: U, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -17,6 +18,7 @@ where pinned: ::pin_project_lite::__private::Pin<&'__pin mut (T)>, unpinned: &'__pin mut (U), } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -31,6 +33,7 @@ where pinned: ::pin_project_lite::__private::Pin<&'__pin (T)>, unpinned: &'__pin (U), } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::mut_mut)] @@ -47,6 +50,7 @@ struct StructProjReplace<T, U> { #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Struct<T, U> { + #[doc(hidden)] #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, @@ -59,6 +63,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, @@ -71,6 +76,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] fn project_replace( self: ::pin_project_lite::__private::Pin<&mut Self>, diff --git a/vendor/pin-project-lite/tests/expand/naming/struct-mut.expanded.rs b/vendor/pin-project-lite/tests/expand/naming/struct-mut.expanded.rs index ed05dbbd1..9b6dae89a 100644 --- a/vendor/pin-project-lite/tests/expand/naming/struct-mut.expanded.rs +++ b/vendor/pin-project-lite/tests/expand/naming/struct-mut.expanded.rs @@ -3,6 +3,7 @@ struct Struct<T, U> { pinned: T, unpinned: U, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -23,6 +24,7 @@ where #[allow(clippy::redundant_pub_crate)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -38,6 +40,7 @@ const _: () = { unpinned: &'__pin (U), } impl<T, U> Struct<T, U> { + #[doc(hidden)] #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, @@ -50,6 +53,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, diff --git a/vendor/pin-project-lite/tests/expand/naming/struct-none.expanded.rs b/vendor/pin-project-lite/tests/expand/naming/struct-none.expanded.rs index fc10dd718..a9792e1f6 100644 --- a/vendor/pin-project-lite/tests/expand/naming/struct-none.expanded.rs +++ b/vendor/pin-project-lite/tests/expand/naming/struct-none.expanded.rs @@ -9,6 +9,7 @@ struct Struct<T, U> { #[allow(clippy::redundant_pub_crate)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -23,6 +24,7 @@ const _: () = { pinned: ::pin_project_lite::__private::Pin<&'__pin mut (T)>, unpinned: &'__pin mut (U), } + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -38,6 +40,7 @@ const _: () = { unpinned: &'__pin (U), } impl<T, U> Struct<T, U> { + #[doc(hidden)] #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, @@ -50,6 +53,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, diff --git a/vendor/pin-project-lite/tests/expand/naming/struct-ref.expanded.rs b/vendor/pin-project-lite/tests/expand/naming/struct-ref.expanded.rs index 4edb63147..9fea20d35 100644 --- a/vendor/pin-project-lite/tests/expand/naming/struct-ref.expanded.rs +++ b/vendor/pin-project-lite/tests/expand/naming/struct-ref.expanded.rs @@ -3,6 +3,7 @@ struct Struct<T, U> { pinned: T, unpinned: U, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -23,6 +24,7 @@ where #[allow(clippy::redundant_pub_crate)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -38,6 +40,7 @@ const _: () = { unpinned: &'__pin mut (U), } impl<T, U> Struct<T, U> { + #[doc(hidden)] #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, @@ -50,6 +53,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, diff --git a/vendor/pin-project-lite/tests/expand/not_unpin/enum.expanded.rs b/vendor/pin-project-lite/tests/expand/not_unpin/enum.expanded.rs new file mode 100644 index 000000000..02cdc239c --- /dev/null +++ b/vendor/pin-project-lite/tests/expand/not_unpin/enum.expanded.rs @@ -0,0 +1,99 @@ +use pin_project_lite::pin_project; +enum Enum<T, U> { + Struct { pinned: T, unpinned: U }, + Unit, +} +#[doc(hidden)] +#[allow(dead_code)] +#[allow(single_use_lifetimes)] +#[allow(clippy::unknown_clippy_lints)] +#[allow(clippy::mut_mut)] +#[allow(clippy::redundant_pub_crate)] +#[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] +enum EnumProj<'__pin, T, U> +where + Enum<T, U>: '__pin, +{ + Struct { + pinned: ::pin_project_lite::__private::Pin<&'__pin mut (T)>, + unpinned: &'__pin mut (U), + }, + Unit, +} +#[doc(hidden)] +#[allow(dead_code)] +#[allow(single_use_lifetimes)] +#[allow(clippy::unknown_clippy_lints)] +#[allow(clippy::mut_mut)] +#[allow(clippy::redundant_pub_crate)] +#[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] +enum EnumProjRef<'__pin, T, U> +where + Enum<T, U>: '__pin, +{ + Struct { + pinned: ::pin_project_lite::__private::Pin<&'__pin (T)>, + unpinned: &'__pin (U), + }, + Unit, +} +#[allow(single_use_lifetimes)] +#[allow(clippy::unknown_clippy_lints)] +#[allow(clippy::used_underscore_binding)] +const _: () = { + impl<T, U> Enum<T, U> { + #[doc(hidden)] + #[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::Unit => EnumProj::Unit, + } + } + } + #[doc(hidden)] + #[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::Unit => EnumProjRef::Unit, + } + } + } + } + #[doc(hidden)] + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum<T, U> + where + ( + ::core::marker::PhantomData<&'__pin ()>, + ::core::marker::PhantomPinned, + ): ::pin_project_lite::__private::Unpin, + {} + trait MustNotImplDrop {} + #[allow(clippy::drop_bounds, drop_bounds)] + impl<T: ::pin_project_lite::__private::Drop> MustNotImplDrop for T {} + impl<T, U> MustNotImplDrop for Enum<T, U> {} +}; +fn main() {} diff --git a/vendor/pin-project-lite/tests/expand/not_unpin/enum.rs b/vendor/pin-project-lite/tests/expand/not_unpin/enum.rs new file mode 100644 index 000000000..0896716ba --- /dev/null +++ b/vendor/pin-project-lite/tests/expand/not_unpin/enum.rs @@ -0,0 +1,17 @@ +use pin_project_lite::pin_project; + +pin_project! { + #[project(!Unpin)] + #[project = EnumProj] + #[project_ref = EnumProjRef] + enum Enum<T, U> { + Struct { + #[pin] + pinned: T, + unpinned: U, + }, + Unit, + } +} + +fn main() {} diff --git a/vendor/pin-project-lite/tests/expand/not_unpin/struct.expanded.rs b/vendor/pin-project-lite/tests/expand/not_unpin/struct.expanded.rs new file mode 100644 index 000000000..2e590b6bf --- /dev/null +++ b/vendor/pin-project-lite/tests/expand/not_unpin/struct.expanded.rs @@ -0,0 +1,88 @@ +use pin_project_lite::pin_project; +struct Struct<T, U> { + pinned: T, + unpinned: U, +} +#[doc(hidden)] +#[allow(dead_code)] +#[allow(single_use_lifetimes)] +#[allow(clippy::unknown_clippy_lints)] +#[allow(clippy::mut_mut)] +#[allow(clippy::redundant_pub_crate)] +#[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] +struct StructProj<'__pin, T, U> +where + Struct<T, U>: '__pin, +{ + pinned: ::pin_project_lite::__private::Pin<&'__pin mut (T)>, + unpinned: &'__pin mut (U), +} +#[doc(hidden)] +#[allow(dead_code)] +#[allow(single_use_lifetimes)] +#[allow(clippy::unknown_clippy_lints)] +#[allow(clippy::mut_mut)] +#[allow(clippy::redundant_pub_crate)] +#[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] +struct StructProjRef<'__pin, T, U> +where + Struct<T, U>: '__pin, +{ + pinned: ::pin_project_lite::__private::Pin<&'__pin (T)>, + unpinned: &'__pin (U), +} +#[allow(explicit_outlives_requirements)] +#[allow(single_use_lifetimes)] +#[allow(clippy::unknown_clippy_lints)] +#[allow(clippy::redundant_pub_crate)] +#[allow(clippy::used_underscore_binding)] +const _: () = { + impl<T, U> Struct<T, U> { + #[doc(hidden)] + #[inline] + fn project<'__pin>( + self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, + ) -> StructProj<'__pin, T, U> { + unsafe { + let Self { pinned, unpinned } = self.get_unchecked_mut(); + StructProj { + pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), + unpinned: unpinned, + } + } + } + #[doc(hidden)] + #[inline] + fn project_ref<'__pin>( + self: ::pin_project_lite::__private::Pin<&'__pin Self>, + ) -> StructProjRef<'__pin, T, U> { + unsafe { + let Self { pinned, unpinned } = self.get_ref(); + StructProjRef { + pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), + unpinned: unpinned, + } + } + } + } + #[doc(hidden)] + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct<T, U> + where + ( + ::core::marker::PhantomData<&'__pin ()>, + ::core::marker::PhantomPinned, + ): ::pin_project_lite::__private::Unpin, + {} + trait MustNotImplDrop {} + #[allow(clippy::drop_bounds, drop_bounds)] + impl<T: ::pin_project_lite::__private::Drop> MustNotImplDrop for T {} + impl<T, U> MustNotImplDrop for Struct<T, U> {} + #[forbid(unaligned_references, safe_packed_borrows)] + fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { + let _ = &this.pinned; + let _ = &this.unpinned; + } +}; +fn main() {} diff --git a/vendor/pin-project-lite/tests/expand/not_unpin/struct.rs b/vendor/pin-project-lite/tests/expand/not_unpin/struct.rs new file mode 100644 index 000000000..0a2967f73 --- /dev/null +++ b/vendor/pin-project-lite/tests/expand/not_unpin/struct.rs @@ -0,0 +1,14 @@ +use pin_project_lite::pin_project; + +pin_project! { + #[project = StructProj] + #[project(!Unpin)] + #[project_ref = StructProjRef] + struct Struct<T, U> { + #[pin] + pinned: T, + unpinned: U, + } +} + +fn main() {} 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 838707dc5..03901ced1 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 @@ -4,6 +4,7 @@ enum Enum<T, U> { Struct { pinned: T, unpinned: U }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -21,6 +22,7 @@ where }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -43,6 +45,7 @@ where #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { + #[doc(hidden)] #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, @@ -61,6 +64,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, 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 567fefa8c..f3fa923fb 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 @@ -10,6 +10,7 @@ struct Struct<T, U> { #[allow(clippy::redundant_pub_crate)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -24,6 +25,7 @@ const _: () = { pinned: ::pin_project_lite::__private::Pin<&'__pin mut (T)>, unpinned: &'__pin mut (U), } + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -39,6 +41,7 @@ const _: () = { unpinned: &'__pin (U), } impl<T, U> Struct<T, U> { + #[doc(hidden)] #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, @@ -51,6 +54,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, diff --git a/vendor/pin-project-lite/tests/expand/pub/enum.expanded.rs b/vendor/pin-project-lite/tests/expand/pub/enum.expanded.rs index aebc3f738..85c7770df 100644 --- a/vendor/pin-project-lite/tests/expand/pub/enum.expanded.rs +++ b/vendor/pin-project-lite/tests/expand/pub/enum.expanded.rs @@ -3,6 +3,7 @@ pub enum Enum<T, U> { Struct { pinned: T, unpinned: U }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -20,6 +21,7 @@ where }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -42,6 +44,7 @@ where #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { + #[doc(hidden)] #[inline] pub(crate) fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, @@ -60,6 +63,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] pub(crate) fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, diff --git a/vendor/pin-project-lite/tests/expand/pub/struct.expanded.rs b/vendor/pin-project-lite/tests/expand/pub/struct.expanded.rs index 7562eb5b7..a06783dc5 100644 --- a/vendor/pin-project-lite/tests/expand/pub/struct.expanded.rs +++ b/vendor/pin-project-lite/tests/expand/pub/struct.expanded.rs @@ -9,6 +9,7 @@ pub struct Struct<T, U> { #[allow(clippy::redundant_pub_crate)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -23,6 +24,7 @@ const _: () = { pub pinned: ::pin_project_lite::__private::Pin<&'__pin mut (T)>, pub unpinned: &'__pin mut (U), } + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -38,6 +40,7 @@ const _: () = { pub unpinned: &'__pin (U), } impl<T, U> Struct<T, U> { + #[doc(hidden)] #[inline] pub(crate) fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, @@ -50,6 +53,7 @@ const _: () = { } } } + #[doc(hidden)] #[inline] pub(crate) fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, diff --git a/vendor/pin-project-lite/tests/lint.rs b/vendor/pin-project-lite/tests/lint.rs index cc3f3951c..94f72fddf 100644 --- a/vendor/pin-project-lite/tests/lint.rs +++ b/vendor/pin-project-lite/tests/lint.rs @@ -10,7 +10,7 @@ // lints forbidden as a part of future_incompatible, rust_2018_compatibility, and rust_2021_compatibility are not included in the list below. // elided_lifetimes_in_paths, explicit_outlives_requirements, unused_extern_crates: as a part of rust_2018_idioms // unsafe_op_in_unsafe_fn: requires Rust 1.52. and, we don't generate unsafe fn. -// non_exhaustive_omitted_patterns: unstable +// non_exhaustive_omitted_patterns, multiple_supertrait_upcastable: unstable // unstable_features: no way to generate #![feature(..)] by macros, expect for unstable inner attribute. and this lint is deprecated: https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unstable-features // unused_crate_dependencies, must_not_suspend: unrelated // unsafe_code: checked in forbid_unsafe module @@ -18,6 +18,7 @@ box_pointers, deprecated_in_future, fuzzy_provenance_casts, + invalid_reference_casting, let_underscore_drop, lossy_provenance_casts, macro_use_extern_crate, @@ -44,7 +45,12 @@ )] #![warn(clippy::all, clippy::pedantic, clippy::nursery, clippy::restriction)] #![allow(clippy::blanket_clippy_restriction_lints)] // this is a test, so enable all restriction lints intentionally. -#![allow(clippy::exhaustive_structs, clippy::exhaustive_enums, clippy::single_char_lifetime_names)] // TODO +#![allow( + clippy::exhaustive_enums, + clippy::exhaustive_structs, + clippy::min_ident_chars, + clippy::single_char_lifetime_names +)] // TODO pub mod basic { include!("include/basic.rs"); @@ -65,6 +71,7 @@ pub mod box_pointers { pin_project! { #[project = EnumProj] #[project_ref = EnumProjRef] + #[project(!Unpin)] #[derive(Debug)] pub enum Enum { Struct { @@ -96,6 +103,7 @@ pub mod explicit_outlives_requirements { pin_project! { #[project = EnumProj] #[project_ref = EnumProjRef] + #[project(!Unpin)] #[derive(Debug)] pub enum Enum<'a, T, U> where @@ -118,6 +126,7 @@ pub mod variant_size_differences { pin_project! { #[project = EnumProj] #[project_ref = EnumProjRef] + #[project(!Unpin)] #[allow(missing_debug_implementations, missing_copy_implementations)] // https://github.com/rust-lang/rust/pull/74060 #[allow(variant_size_differences)] // for the type itself #[allow(clippy::large_enum_variant)] // for the type itself @@ -143,6 +152,7 @@ pub mod clippy_mut_mut { pin_project! { #[project = EnumProj] #[project_ref = EnumProjRef] + #[project(!Unpin)] #[derive(Debug)] pub enum Enum<'a, T, U> { Struct { @@ -171,6 +181,7 @@ mod clippy_redundant_pub_crate { pin_project! { #[project = EnumProj] #[project_ref = EnumProjRef] + #[project(!Unpin)] #[derive(Debug)] pub enum Enum<T, U> { Struct { @@ -202,6 +213,7 @@ pub mod clippy_type_repetition_in_bounds { pin_project! { #[project = EnumProj] #[project_ref = EnumProjRef] + #[project(!Unpin)] #[derive(Debug)] pub enum Enum<T, U> where @@ -232,6 +244,7 @@ pub mod clippy_used_underscore_binding { pin_project! { #[project = EnumProj] #[project_ref = EnumProjRef] + #[project(!Unpin)] pub enum Enum<T, U> { Struct { #[pin] @@ -256,6 +269,7 @@ pub mod clippy_ref_option_ref { pin_project! { #[project = EnumProj] #[project_ref = EnumProjRef] + #[project(!Unpin)] pub enum Enum<'a> { Struct { #[pin] diff --git a/vendor/pin-project-lite/tests/proper_unpin.rs b/vendor/pin-project-lite/tests/proper_unpin.rs index 668e975ba..89235a4d3 100644 --- a/vendor/pin-project-lite/tests/proper_unpin.rs +++ b/vendor/pin-project-lite/tests/proper_unpin.rs @@ -47,6 +47,18 @@ pub mod default { assert_not_unpin!(Enum<PhantomPinned, PhantomPinned>); pin_project! { + #[project(!Unpin)] + enum NotUnpinEnum<T, U> { + V1 { + #[pin] f1: Inner<T>, + f2: U, + } + } + } + + assert_not_unpin!(NotUnpinEnum<(), ()>); + + pin_project! { struct TrivialBounds { #[pin] f: PhantomPinned, @@ -64,4 +76,25 @@ pub mod default { } assert_unpin!(PinRef<'_, PhantomPinned, PhantomPinned>); + + pin_project! { + #[project(!Unpin)] + struct NotUnpin<U> { + #[pin] + u: U + } + } + + assert_not_unpin!(NotUnpin<()>); + + pin_project! { + #[project(!Unpin)] + struct NotUnpinRef<'a, T, U> { + #[pin] + f1: &'a mut Inner<T>, + f2: U + } + } + + assert_not_unpin!(NotUnpinRef<'_, (), ()>); } diff --git a/vendor/pin-project-lite/tests/test.rs b/vendor/pin-project-lite/tests/test.rs index ed9b75c42..d12893005 100644 --- a/vendor/pin-project-lite/tests/test.rs +++ b/vendor/pin-project-lite/tests/test.rs @@ -616,6 +616,7 @@ fn attrs() { pin_project! { /// dox1 #[derive(Clone)] + #[project(!Unpin)] #[project = Enum2Proj] #[project_ref = Enum2ProjRef] /// dox2 @@ -682,11 +683,13 @@ fn pinned_drop() { req: Request, } + /// dox1 impl<T, Request> PinnedDrop for Struct3<'_, T, Request> where T: Service<Request>, T::Error: std::error::Error, { + /// dox2 fn drop(mut this: Pin<&mut Self>) { **this.as_mut().project().was_dropped = true; } diff --git a/vendor/pin-project-lite/tests/ui/pin_project/conflict-unpin.rs b/vendor/pin-project-lite/tests/ui/pin_project/conflict-unpin.rs index f702f064d..bdab20fc2 100644 --- a/vendor/pin-project-lite/tests/ui/pin_project/conflict-unpin.rs +++ b/vendor/pin-project-lite/tests/ui/pin_project/conflict-unpin.rs @@ -37,4 +37,28 @@ pin_project! { //~ ERROR E0119 // conflicting implementations impl<T: Unpin, U: Unpin> Unpin for Baz<T, U> {} // Conditional Unpin impl +pin_project! { //~ ERROR E0119 + #[project(!Unpin)] + struct Qux<T, U> { + #[pin] + future: T, + field: U, + } +} + +// conflicting implementations +impl<T, U> Unpin for Qux<T, U> {} // Non-conditional Unpin impl + +pin_project! { //~ ERROR E0119 + #[project(!Unpin)] + struct Fred<T, U> { + #[pin] + future: T, + field: U, + } +} + +// conflicting implementations +impl<T: Unpin, U: Unpin> Unpin for Fred<T, U> {} // Conditional Unpin impl + fn main() {} diff --git a/vendor/pin-project-lite/tests/ui/pin_project/conflict-unpin.stderr b/vendor/pin-project-lite/tests/ui/pin_project/conflict-unpin.stderr index 3ac8c1f83..cf9818e08 100644 --- a/vendor/pin-project-lite/tests/ui/pin_project/conflict-unpin.stderr +++ b/vendor/pin-project-lite/tests/ui/pin_project/conflict-unpin.stderr @@ -48,3 +48,37 @@ error[E0119]: conflicting implementations of trait `Unpin` for type `Baz<_, _>` | -------------------------------------------- first implementation here | = note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0119]: conflicting implementations of trait `Unpin` for type `Qux<_, _>` + --> tests/ui/pin_project/conflict-unpin.rs:40:1 + | +40 | / pin_project! { //~ ERROR E0119 +41 | | #[project(!Unpin)] +42 | | struct Qux<T, U> { +43 | | #[pin] +... | +46 | | } +47 | | } + | |_^ conflicting implementation for `Qux<_, _>` +... +50 | impl<T, U> Unpin for Qux<T, U> {} // Non-conditional Unpin impl + | ------------------------------ first implementation here + | + = note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0119]: conflicting implementations of trait `Unpin` for type `Fred<_, _>` + --> tests/ui/pin_project/conflict-unpin.rs:52:1 + | +52 | / pin_project! { //~ ERROR E0119 +53 | | #[project(!Unpin)] +54 | | struct Fred<T, U> { +55 | | #[pin] +... | +58 | | } +59 | | } + | |_^ conflicting implementation for `Fred<_, _>` +... +62 | impl<T: Unpin, U: Unpin> Unpin for Fred<T, U> {} // Conditional Unpin impl + | --------------------------------------------- first implementation here + | + = note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) |