Replace maybe_uninit_ref with stable api

Is there a way to get ref from MaybeUninit in stable rust, and when do this feature merge into the stable version ?

You can use as_ptr and deref the raw pointer

let x: MaybeUninit<_> = ,,,;
let x_ref = unsafe { &*x.as_ptr() };
1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.