pub const unsafe fn slice_get_unchecked<ItemPtr, SlicePtr, T>(
slice_ptr: SlicePtr,
index: usize,
) -> ItemPtrwhere
ItemPtr: ChangePointee<[T], Pointee = T, Output = SlicePtr>,
core_intrinsics)
Projects to the index-th element of slice_ptr, as the same kind of pointer as the slice was provided β so &mut [T] β &mut T, &[T] β &T, *mut [T] β *mut T, or *const [T] β *const T β without a bounds check.
This is exposed via <usize as SliceIndex>::get(_unchecked)(_mut), and isnβt intended to be used elsewhere.
Expands in MIR to {&, &mut, &raw const, &raw mut} (*slice_ptr)[index], depending on the types involved, so no backend support is needed.
index < PtrMetadata(slice_ptr), so the indexing is in-bounds for the slice
Β© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/intrinsics/fn.slice_get_unchecked.html