Feature gate: #![feature(get_many_mut)]
This is a tracking issue for get_disjoint_mut and get_disjoint_unchecked_mut, which provide &mut T access to multiple distinct slice elements.
Public API
impl [T] {
pub unsafe fn get_disjoint_unchecked_mut<const N: usize>(&mut self, indices: [usize; N]) -> [&mut T; N];
pub fn get_disjoint_mut<const N: usize>(&mut self, indices: [usize; N]) -> Result<[&mut T; N], GetDisjointMutError<N>>;
}
pub struct GetDisjointMutError<const N: usize> { /* private */ }
Steps / History
Unresolved Questions
- What should the error type / return type look like?
- Should the interface support non-usize indices (e.g.,
get_many_mut([0..3, 4..6]))?
- What are the requirements for the interface? Do we sort the passed array, and then check distinctness, or check in
O(n^2) time?
Feature gate:
#![feature(get_many_mut)]This is a tracking issue for
get_disjoint_mutandget_disjoint_unchecked_mut, which provide&mut Taccess to multiple distinct slice elements.Public API
Steps / History
get_many_mutasget_disjoint_mut#134633Unresolved Questions
get_many_mut([0..3, 4..6]))?O(n^2)time?