aboutsummaryrefslogtreecommitdiff
path: root/examples/project_replace-expanded.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/project_replace-expanded.rs')
-rw-r--r--examples/project_replace-expanded.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/examples/project_replace-expanded.rs b/examples/project_replace-expanded.rs
index ec00d41..4f43bda 100644
--- a/examples/project_replace-expanded.rs
+++ b/examples/project_replace-expanded.rs
@@ -76,13 +76,6 @@ const _: () = {
) -> __StructProjectionOwned<T, U> {
unsafe {
let __self_ptr: *mut Self = self.get_unchecked_mut();
- let Self { pinned, unpinned } = &mut *__self_ptr;
-
- // First, extract all the unpinned fields
- let __result = __StructProjectionOwned {
- pinned: ::pin_project::__private::PhantomData,
- unpinned: ::pin_project::__private::ptr::read(unpinned),
- };
// Destructors will run in reverse order, so next create a guard to overwrite
// `self` with the replacement value without calling destructors.
@@ -91,6 +84,14 @@ const _: () = {
value: ::pin_project::__private::ManuallyDrop::new(__replacement),
};
+ let Self { pinned, unpinned } = &mut *__self_ptr;
+
+ // First, extract all the unpinned fields
+ let __result = __StructProjectionOwned {
+ pinned: ::pin_project::__private::PhantomData,
+ unpinned: ::pin_project::__private::ptr::read(unpinned),
+ };
+
// Now create guards to drop all the pinned fields
//
// Due to a compiler bug (https://github.com/rust-lang/rust/issues/47949)