blart::rust_nightly_apis

Function maybe_uninit_slice_assume_init_ref

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

Assuming all the elements are initialized, get a slice to them.

ยงSafety

It is up to the caller to guarantee that the MaybeUninit<T> elements really are in an initialized state. Calling this when the content is not yet fully initialized causes undefined behavior.

See assume_init_ref for more details and examples.

This is a unstable API copied from the Rust standard library, tracking issue is #63569