assume_init_ref

Function assume_init_ref 

Source
pub const unsafe fn assume_init_ref<T>(slice: &[MaybeUninit<T>]) -> &[T]
Expand description

Gets a shared reference to the contained value.

ยงSafety

Calling this when the content is not yet fully initialized causes undefined behavior: it is up to the caller to guarantee that every MaybeUninit<T> in the slice really is in an initialized state.

Copied from: https://doc.rust-lang.org/std/primitive.slice.html#method.assume_init_ref Once that is stabilized, this should be removed.