Constify slice index for strings
This commit is contained in:
@@ -276,9 +276,10 @@ impl<'a, T, const N: usize> IntoIterator for &'a mut [T; N] {
|
||||
}
|
||||
|
||||
#[stable(feature = "index_trait_on_arrays", since = "1.50.0")]
|
||||
impl<T, I, const N: usize> Index<I> for [T; N]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
impl<T, I, const N: usize> const Index<I> for [T; N]
|
||||
where
|
||||
[T]: Index<I>,
|
||||
[T]: ~const Index<I>,
|
||||
{
|
||||
type Output = <[T] as Index<I>>::Output;
|
||||
|
||||
@@ -289,9 +290,10 @@ where
|
||||
}
|
||||
|
||||
#[stable(feature = "index_trait_on_arrays", since = "1.50.0")]
|
||||
impl<T, I, const N: usize> IndexMut<I> for [T; N]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
impl<T, I, const N: usize> const IndexMut<I> for [T; N]
|
||||
where
|
||||
[T]: IndexMut<I>,
|
||||
[T]: ~const IndexMut<I>,
|
||||
{
|
||||
#[inline]
|
||||
fn index_mut(&mut self, index: I) -> &mut Self::Output {
|
||||
|
||||
Reference in New Issue
Block a user