diff options
author | Haibo Huang <hhb@google.com> | 2021-02-24 11:40:40 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-02-24 11:40:40 +0000 |
commit | 73bddac7fe5f72bd4dd18fe1c75bb2aedec826b3 (patch) | |
tree | aa583765ea0c0fd8bddb46d99bb04eae1334edd3 /tests/expand/not_unpin/struct.expanded.rs | |
parent | e0f6db25e95895f9c50347c4010b2ea0d1fb917a (diff) | |
parent | 3e9a78f8a652042b466f19f7cfd9a72c7e6967c0 (diff) | |
download | pin-project-73bddac7fe5f72bd4dd18fe1c75bb2aedec826b3.tar.gz |
Upgrade rust/crates/pin-project to 1.0.5 am: c1311073c0 am: 839279b456 am: 60a03099d2 am: 3e9a78f8a6
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pin-project/+/1581962
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I16859831071921a72781e55ff01246fc92478390
Diffstat (limited to 'tests/expand/not_unpin/struct.expanded.rs')
-rw-r--r-- | tests/expand/not_unpin/struct.expanded.rs | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/tests/expand/not_unpin/struct.expanded.rs b/tests/expand/not_unpin/struct.expanded.rs new file mode 100644 index 0000000..9d58022 --- /dev/null +++ b/tests/expand/not_unpin/struct.expanded.rs @@ -0,0 +1,104 @@ +use pin_project::pin_project; +# [pin (__private (! Unpin))] +struct Struct<T, U> { + #[pin] + pinned: T, + unpinned: U, +} +#[allow(box_pointers)] +#[allow(deprecated)] +#[allow(explicit_outlives_requirements)] +#[allow(single_use_lifetimes)] +#[allow(unreachable_pub)] +#[allow(clippy::unknown_clippy_lints)] +#[allow(clippy::pattern_type_mismatch)] +#[allow(clippy::redundant_pub_crate)] +#[allow(clippy::used_underscore_binding)] +const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] + #[allow(dead_code)] + #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] + struct __StructProjection<'pin, T, U> + where + Struct<T, U>: 'pin, + { + pinned: ::pin_project::__private::Pin<&'pin mut (T)>, + unpinned: &'pin mut (U), + } + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] + #[allow(dead_code)] + #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] + struct __StructProjectionRef<'pin, T, U> + where + Struct<T, U>: 'pin, + { + pinned: ::pin_project::__private::Pin<&'pin (T)>, + unpinned: &'pin (U), + } + impl<T, U> Struct<T, U> { + fn project<'pin>( + self: ::pin_project::__private::Pin<&'pin mut Self>, + ) -> __StructProjection<'pin, T, U> { + unsafe { + let Self { pinned, unpinned } = self.get_unchecked_mut(); + __StructProjection { + pinned: ::pin_project::__private::Pin::new_unchecked(pinned), + unpinned, + } + } + } + #[allow(clippy::missing_const_for_fn)] + fn project_ref<'pin>( + self: ::pin_project::__private::Pin<&'pin Self>, + ) -> __StructProjectionRef<'pin, T, U> { + unsafe { + let Self { pinned, unpinned } = self.get_ref(); + __StructProjectionRef { + pinned: ::pin_project::__private::Pin::new_unchecked(pinned), + unpinned, + } + } + } + } + #[forbid(safe_packed_borrows)] + fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { + let _ = &this.pinned; + let _ = &this.unpinned; + } + impl<'pin, T, U> ::pin_project::__private::Unpin for Struct<T, U> where + ::pin_project::__private::Wrapper<'pin, ::pin_project::__private::PhantomPinned>: + ::pin_project::__private::Unpin + { + } + #[doc(hidden)] + unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Struct<T, U> where + ::pin_project::__private::Wrapper<'pin, ::pin_project::__private::PhantomPinned>: + ::pin_project::__private::Unpin + { + } + trait StructMustNotImplDrop {} + #[allow(clippy::drop_bounds, drop_bounds)] + impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {} + impl<T, U> StructMustNotImplDrop for Struct<T, U> {} + #[doc(hidden)] + impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> { + unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {} + } +}; +fn main() {} |