Function slice_from_raw_parts_mut
const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T]
Forms a raw mutable slice from a pointer and a length.
The len argument is the number of elements, not the number of bytes.
Performs the same functionality as slice_from_raw_parts, except that a
raw mutable slice is returned, as opposed to a raw immutable slice.
This function is safe, but actually using the return value is unsafe.
See the documentation of slice::from_raw_parts_mut for slice safety requirements.
Examples
use ptr;
let x = &mut ;
let raw_pointer = x.as_mut_ptr;
let slice = slice_from_raw_parts_mut;
unsafe ;
assert_eq!;
You must ensure that the pointer is valid and not null before dereferencing the raw slice. A slice reference must never have a null pointer, even if it's empty.
use ptr;
let danger: *mut = slice_from_raw_parts_mut;
unsafe