diff --git a/src/lib.rs b/src/lib.rs index 6268acf..a579801 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -329,7 +329,8 @@ impl<'a, T> RefOnce<'a, T> { impl RefOnce<'_, T> { // TODO: make public fn into_raw(this: Self) -> *mut Once { - ptr::addr_of_mut!(*this.slot) + let this = mem::ManuallyDrop::new(this); + ptr::from_mut(unsafe { ptr::read(&this.slot) }) } }