aboutsummaryrefslogtreecommitdiff
path: root/tests/expand/pub
diff options
context:
space:
mode:
Diffstat (limited to 'tests/expand/pub')
-rw-r--r--tests/expand/pub/enum.expanded.rs64
-rw-r--r--tests/expand/pub/struct.expanded.rs19
-rw-r--r--tests/expand/pub/tuple_struct.expanded.rs29
3 files changed, 66 insertions, 46 deletions
diff --git a/tests/expand/pub/enum.expanded.rs b/tests/expand/pub/enum.expanded.rs
index 530eca9..90be268 100644
--- a/tests/expand/pub/enum.expanded.rs
+++ b/tests/expand/pub/enum.expanded.rs
@@ -1,11 +1,7 @@
use pin_project::pin_project;
-# [pin (__private (project = EnumProj , project_ref = EnumProjRef))]
+#[pin(__private(project = EnumProj, project_ref = EnumProjRef))]
pub enum Enum<T, U> {
- Struct {
- #[pin]
- pinned: T,
- unpinned: U,
- },
+ Struct { #[pin] pinned: T, unpinned: U },
Tuple(#[pin] T, U),
Unit,
}
@@ -14,6 +10,7 @@ pub enum Enum<T, U> {
#[allow(explicit_outlives_requirements)]
#[allow(single_use_lifetimes)]
#[allow(unreachable_pub)]
+#[allow(unused_tuple_struct_fields)]
#[allow(clippy::unknown_clippy_lints)]
#[allow(clippy::pattern_type_mismatch)]
#[allow(clippy::redundant_pub_crate)]
@@ -36,6 +33,7 @@ where
#[allow(explicit_outlives_requirements)]
#[allow(single_use_lifetimes)]
#[allow(unreachable_pub)]
+#[allow(unused_tuple_struct_fields)]
#[allow(clippy::unknown_clippy_lints)]
#[allow(clippy::pattern_type_mismatch)]
#[allow(clippy::redundant_pub_crate)]
@@ -46,10 +44,7 @@ pub(crate) enum EnumProjRef<'pin, T, U>
where
Enum<T, U>: 'pin,
{
- Struct {
- pinned: ::pin_project::__private::Pin<&'pin (T)>,
- unpinned: &'pin (U),
- },
+ Struct { pinned: ::pin_project::__private::Pin<&'pin (T)>, unpinned: &'pin (U) },
Tuple(::pin_project::__private::Pin<&'pin (T)>, &'pin (U)),
Unit,
}
@@ -58,6 +53,7 @@ where
#[allow(explicit_outlives_requirements)]
#[allow(single_use_lifetimes)]
#[allow(unreachable_pub)]
+#[allow(unused_tuple_struct_fields)]
#[allow(clippy::unknown_clippy_lints)]
#[allow(clippy::pattern_type_mismatch)]
#[allow(clippy::redundant_pub_crate)]
@@ -70,34 +66,46 @@ const _: () = {
#[allow(unused_extern_crates)]
extern crate pin_project as _pin_project;
impl<T, U> Enum<T, U> {
+ #[allow(dead_code)]
pub(crate) fn project<'pin>(
self: _pin_project::__private::Pin<&'pin mut Self>,
) -> EnumProj<'pin, T, U> {
unsafe {
match self.get_unchecked_mut() {
- Self::Struct { pinned, unpinned } => EnumProj::Struct {
- pinned: _pin_project::__private::Pin::new_unchecked(pinned),
- unpinned,
- },
+ Self::Struct { pinned, unpinned } => {
+ EnumProj::Struct {
+ pinned: _pin_project::__private::Pin::new_unchecked(pinned),
+ unpinned,
+ }
+ }
Self::Tuple(_0, _1) => {
- EnumProj::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
+ EnumProj::Tuple(
+ _pin_project::__private::Pin::new_unchecked(_0),
+ _1,
+ )
}
Self::Unit => EnumProj::Unit,
}
}
}
+ #[allow(dead_code)]
#[allow(clippy::missing_const_for_fn)]
pub(crate) fn project_ref<'pin>(
self: _pin_project::__private::Pin<&'pin Self>,
) -> EnumProjRef<'pin, T, U> {
unsafe {
match self.get_ref() {
- Self::Struct { pinned, unpinned } => EnumProjRef::Struct {
- pinned: _pin_project::__private::Pin::new_unchecked(pinned),
- unpinned,
- },
+ Self::Struct { pinned, unpinned } => {
+ EnumProjRef::Struct {
+ pinned: _pin_project::__private::Pin::new_unchecked(pinned),
+ unpinned,
+ }
+ }
Self::Tuple(_0, _1) => {
- EnumProjRef::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
+ EnumProjRef::Tuple(
+ _pin_project::__private::Pin::new_unchecked(_0),
+ _1,
+ )
}
Self::Unit => EnumProjRef::Unit,
}
@@ -116,15 +124,15 @@ const _: () = {
__field0: T,
__field1: T,
}
- impl<'pin, T, U> _pin_project::__private::Unpin for Enum<T, U> where
- __Enum<'pin, T, U>: _pin_project::__private::Unpin
- {
- }
+ impl<'pin, T, U> _pin_project::__private::Unpin for Enum<T, U>
+ where
+ __Enum<'pin, T, U>: _pin_project::__private::Unpin,
+ {}
#[doc(hidden)]
- unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Enum<T, U> where
- __Enum<'pin, T, U>: _pin_project::__private::Unpin
- {
- }
+ unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Enum<T, U>
+ where
+ __Enum<'pin, T, U>: _pin_project::__private::Unpin,
+ {}
trait EnumMustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
impl<T: _pin_project::__private::Drop> EnumMustNotImplDrop for T {}
diff --git a/tests/expand/pub/struct.expanded.rs b/tests/expand/pub/struct.expanded.rs
index 71ae3a3..ca31f3d 100644
--- a/tests/expand/pub/struct.expanded.rs
+++ b/tests/expand/pub/struct.expanded.rs
@@ -10,6 +10,7 @@ pub struct Struct<T, U> {
#[allow(explicit_outlives_requirements)]
#[allow(single_use_lifetimes)]
#[allow(unreachable_pub)]
+#[allow(unused_tuple_struct_fields)]
#[allow(clippy::unknown_clippy_lints)]
#[allow(clippy::pattern_type_mismatch)]
#[allow(clippy::redundant_pub_crate)]
@@ -40,6 +41,7 @@ const _: () = {
pub unpinned: &'pin (U),
}
impl<T, U> Struct<T, U> {
+ #[allow(dead_code)]
pub(crate) fn project<'pin>(
self: _pin_project::__private::Pin<&'pin mut Self>,
) -> __StructProjection<'pin, T, U> {
@@ -51,6 +53,7 @@ const _: () = {
}
}
}
+ #[allow(dead_code)]
#[allow(clippy::missing_const_for_fn)]
pub(crate) fn project_ref<'pin>(
self: _pin_project::__private::Pin<&'pin Self>,
@@ -80,15 +83,15 @@ const _: () = {
>,
__field0: T,
}
- impl<'pin, T, U> _pin_project::__private::Unpin for Struct<T, U> where
- __Struct<'pin, T, U>: _pin_project::__private::Unpin
- {
- }
+ impl<'pin, T, U> _pin_project::__private::Unpin for Struct<T, U>
+ where
+ __Struct<'pin, T, U>: _pin_project::__private::Unpin,
+ {}
#[doc(hidden)]
- unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Struct<T, U> where
- __Struct<'pin, T, U>: _pin_project::__private::Unpin
- {
- }
+ unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Struct<T, U>
+ where
+ __Struct<'pin, T, U>: _pin_project::__private::Unpin,
+ {}
trait StructMustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
impl<T: _pin_project::__private::Drop> StructMustNotImplDrop for T {}
diff --git a/tests/expand/pub/tuple_struct.expanded.rs b/tests/expand/pub/tuple_struct.expanded.rs
index 02c3f24..5c7efbf 100644
--- a/tests/expand/pub/tuple_struct.expanded.rs
+++ b/tests/expand/pub/tuple_struct.expanded.rs
@@ -6,6 +6,7 @@ pub struct TupleStruct<T, U>(#[pin] pub T, pub U);
#[allow(explicit_outlives_requirements)]
#[allow(single_use_lifetimes)]
#[allow(unreachable_pub)]
+#[allow(unused_tuple_struct_fields)]
#[allow(clippy::unknown_clippy_lints)]
#[allow(clippy::pattern_type_mismatch)]
#[allow(clippy::redundant_pub_crate)]
@@ -34,21 +35,29 @@ const _: () = {
where
TupleStruct<T, U>: 'pin;
impl<T, U> TupleStruct<T, U> {
+ #[allow(dead_code)]
pub(crate) fn project<'pin>(
self: _pin_project::__private::Pin<&'pin mut Self>,
) -> __TupleStructProjection<'pin, T, U> {
unsafe {
let Self(_0, _1) = self.get_unchecked_mut();
- __TupleStructProjection(_pin_project::__private::Pin::new_unchecked(_0), _1)
+ __TupleStructProjection(
+ _pin_project::__private::Pin::new_unchecked(_0),
+ _1,
+ )
}
}
+ #[allow(dead_code)]
#[allow(clippy::missing_const_for_fn)]
pub(crate) fn project_ref<'pin>(
self: _pin_project::__private::Pin<&'pin Self>,
) -> __TupleStructProjectionRef<'pin, T, U> {
unsafe {
let Self(_0, _1) = self.get_ref();
- __TupleStructProjectionRef(_pin_project::__private::Pin::new_unchecked(_0), _1)
+ __TupleStructProjectionRef(
+ _pin_project::__private::Pin::new_unchecked(_0),
+ _1,
+ )
}
}
}
@@ -68,15 +77,15 @@ const _: () = {
>,
__field0: T,
}
- impl<'pin, T, U> _pin_project::__private::Unpin for TupleStruct<T, U> where
- __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
- {
- }
+ impl<'pin, T, U> _pin_project::__private::Unpin for TupleStruct<T, U>
+ where
+ __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin,
+ {}
#[doc(hidden)]
- unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for TupleStruct<T, U> where
- __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
- {
- }
+ unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for TupleStruct<T, U>
+ where
+ __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin,
+ {}
trait TupleStructMustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
impl<T: _pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}