diff --git a/src/lib.rs b/src/lib.rs index 6268acf..1129a0c 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); + unsafe { ptr::addr_of!(this.slot).read() } } }