diff options
author | Haibo Huang <hhb@google.com> | 2020-05-18 15:51:06 -0700 |
---|---|---|
committer | Haibo Huang <hhb@google.com> | 2020-05-18 15:51:06 -0700 |
commit | 2960bb3286f62288b139b5251c4fae8af4b229da (patch) | |
tree | f05ba22a13d80ded5528edd1bf8a9e0aa5451a51 /examples | |
parent | 6f3e9271b123f94f158b1f000c996a558351320f (diff) | |
download | pin-project-2960bb3286f62288b139b5251c4fae8af4b229da.tar.gz |
Upgrade rust/crates/pin-project to 0.4.17platform-tools-30.0.3platform-tools-30.0.2
Test: None
Change-Id: Ief1c86f13cbb3473c76f2435a0198c7e3efbd2cf
Diffstat (limited to 'examples')
-rw-r--r-- | examples/enum-default-expanded.rs | 15 | ||||
-rw-r--r-- | examples/enum-default.rs | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/examples/enum-default-expanded.rs b/examples/enum-default-expanded.rs index 036c01f..845645a 100644 --- a/examples/enum-default-expanded.rs +++ b/examples/enum-default-expanded.rs @@ -5,7 +5,7 @@ // // use pin_project::pin_project; // -// #[pin_project] +// #[pin_project(project = EnumProj)] // enum Enum<T, U> { // Pinned(#[pin] T), // Unpinned(U), @@ -24,11 +24,10 @@ enum Enum<T, U> { Unpinned(U), } -#[doc(hidden)] #[allow(clippy::mut_mut)] // This lint warns `&mut &mut <ty>`. #[allow(dead_code)] // This lint warns unused fields/variants. #[allow(single_use_lifetimes)] -enum __EnumProjection<'pin, T, U> +enum EnumProj<'pin, T, U> where Enum<T, U>: 'pin, { @@ -53,13 +52,13 @@ const __SCOPE_Enum: () = { impl<T, U> Enum<T, U> { fn project<'pin>( self: ::pin_project::__reexport::pin::Pin<&'pin mut Self>, - ) -> __EnumProjection<'pin, T, U> { + ) -> EnumProj<'pin, T, U> { unsafe { match self.get_unchecked_mut() { - Enum::Pinned(_0) => __EnumProjection::Pinned( - ::pin_project::__reexport::pin::Pin::new_unchecked(_0), - ), - Enum::Unpinned(_0) => __EnumProjection::Unpinned(_0), + Enum::Pinned(_0) => { + EnumProj::Pinned(::pin_project::__reexport::pin::Pin::new_unchecked(_0)) + } + Enum::Unpinned(_0) => EnumProj::Unpinned(_0), } } } diff --git a/examples/enum-default.rs b/examples/enum-default.rs index ab5a4bc..bd3f2e6 100644 --- a/examples/enum-default.rs +++ b/examples/enum-default.rs @@ -4,7 +4,7 @@ use pin_project::pin_project; -#[pin_project] +#[pin_project(project = EnumProj)] enum Enum<T, U> { Pinned(#[pin] T), Unpinned(U), |