]> git.lizzy.rs Git - rust.git/blobdiff - library/core/src/array/mod.rs
Auto merge of #94517 - aDotInTheVoid:inline_wrapping_next_power_two, r=yaahc
[rust.git] / library / core / src / array / mod.rs
index ee79021ed536e69555e6a8ba2c470549143fd7e8..20dfbc6347c4fb761f24ab5ee32ef864470ca301 100644 (file)
@@ -276,9 +276,10 @@ fn into_iter(self) -> IterMut<'a, T> {
 }
 
 #[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 @@ fn index(&self, index: I) -> &Self::Output {
 }
 
 #[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 {