@@ -1043,9 +1043,10 @@ impl<T> [T] {
10431043 /// assert_eq!(iterator.next(), None);
10441044 /// ```
10451045 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1046+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
10461047 #[ inline]
10471048 #[ rustc_diagnostic_item = "slice_iter" ]
1048- pub fn iter ( & self ) -> Iter < ' _ , T > {
1049+ pub const fn iter ( & self ) -> Iter < ' _ , T > {
10491050 Iter :: new ( self )
10501051 }
10511052
@@ -1062,9 +1063,10 @@ impl<T> [T] {
10621063 /// }
10631064 /// assert_eq!(x, &[3, 4, 6]);
10641065 /// ```
1066+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
10651067 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
10661068 #[ inline]
1067- pub fn iter_mut ( & mut self ) -> IterMut < ' _ , T > {
1069+ pub const fn iter_mut ( & mut self ) -> IterMut < ' _ , T > {
10681070 IterMut :: new ( self )
10691071 }
10701072
@@ -1116,9 +1118,10 @@ impl<T> [T] {
11161118 /// assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
11171119 /// ```
11181120 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1121+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
11191122 #[ inline]
11201123 #[ track_caller]
1121- pub fn windows ( & self , size : usize ) -> Windows < ' _ , T > {
1124+ pub const fn windows ( & self , size : usize ) -> Windows < ' _ , T > {
11221125 let size = NonZero :: new ( size) . expect ( "window size must be non-zero" ) ;
11231126 Windows :: new ( self , size)
11241127 }
@@ -1151,9 +1154,10 @@ impl<T> [T] {
11511154 /// [`chunks_exact`]: slice::chunks_exact
11521155 /// [`rchunks`]: slice::rchunks
11531156 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1157+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
11541158 #[ inline]
11551159 #[ track_caller]
1156- pub fn chunks ( & self , chunk_size : usize ) -> Chunks < ' _ , T > {
1160+ pub const fn chunks ( & self , chunk_size : usize ) -> Chunks < ' _ , T > {
11571161 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
11581162 Chunks :: new ( self , chunk_size)
11591163 }
@@ -1190,9 +1194,10 @@ impl<T> [T] {
11901194 /// [`chunks_exact_mut`]: slice::chunks_exact_mut
11911195 /// [`rchunks_mut`]: slice::rchunks_mut
11921196 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1197+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
11931198 #[ inline]
11941199 #[ track_caller]
1195- pub fn chunks_mut ( & mut self , chunk_size : usize ) -> ChunksMut < ' _ , T > {
1200+ pub const fn chunks_mut ( & mut self , chunk_size : usize ) -> ChunksMut < ' _ , T > {
11961201 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
11971202 ChunksMut :: new ( self , chunk_size)
11981203 }
@@ -1228,9 +1233,10 @@ impl<T> [T] {
12281233 /// [`chunks`]: slice::chunks
12291234 /// [`rchunks_exact`]: slice::rchunks_exact
12301235 #[ stable( feature = "chunks_exact" , since = "1.31.0" ) ]
1236+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
12311237 #[ inline]
12321238 #[ track_caller]
1233- pub fn chunks_exact ( & self , chunk_size : usize ) -> ChunksExact < ' _ , T > {
1239+ pub const fn chunks_exact ( & self , chunk_size : usize ) -> ChunksExact < ' _ , T > {
12341240 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
12351241 ChunksExact :: new ( self , chunk_size)
12361242 }
@@ -1271,9 +1277,10 @@ impl<T> [T] {
12711277 /// [`chunks_mut`]: slice::chunks_mut
12721278 /// [`rchunks_exact_mut`]: slice::rchunks_exact_mut
12731279 #[ stable( feature = "chunks_exact" , since = "1.31.0" ) ]
1280+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
12741281 #[ inline]
12751282 #[ track_caller]
1276- pub fn chunks_exact_mut ( & mut self , chunk_size : usize ) -> ChunksExactMut < ' _ , T > {
1283+ pub const fn chunks_exact_mut ( & mut self , chunk_size : usize ) -> ChunksExactMut < ' _ , T > {
12771284 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
12781285 ChunksExactMut :: new ( self , chunk_size)
12791286 }
@@ -1429,9 +1436,10 @@ impl<T> [T] {
14291436 ///
14301437 /// [`chunks_exact`]: slice::chunks_exact
14311438 #[ unstable( feature = "array_chunks" , issue = "74985" ) ]
1439+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
14321440 #[ inline]
14331441 #[ track_caller]
1434- pub fn array_chunks < const N : usize > ( & self ) -> ArrayChunks < ' _ , T , N > {
1442+ pub const fn array_chunks < const N : usize > ( & self ) -> ArrayChunks < ' _ , T , N > {
14351443 assert ! ( N != 0 , "chunk size must be non-zero" ) ;
14361444 ArrayChunks :: new ( self )
14371445 }
@@ -1592,9 +1600,10 @@ impl<T> [T] {
15921600 ///
15931601 /// [`chunks_exact_mut`]: slice::chunks_exact_mut
15941602 #[ unstable( feature = "array_chunks" , issue = "74985" ) ]
1603+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
15951604 #[ inline]
15961605 #[ track_caller]
1597- pub fn array_chunks_mut < const N : usize > ( & mut self ) -> ArrayChunksMut < ' _ , T , N > {
1606+ pub const fn array_chunks_mut < const N : usize > ( & mut self ) -> ArrayChunksMut < ' _ , T , N > {
15981607 assert ! ( N != 0 , "chunk size must be non-zero" ) ;
15991608 ArrayChunksMut :: new ( self )
16001609 }
@@ -1625,9 +1634,10 @@ impl<T> [T] {
16251634 ///
16261635 /// [`windows`]: slice::windows
16271636 #[ unstable( feature = "array_windows" , issue = "75027" ) ]
1637+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
16281638 #[ inline]
16291639 #[ track_caller]
1630- pub fn array_windows < const N : usize > ( & self ) -> ArrayWindows < ' _ , T , N > {
1640+ pub const fn array_windows < const N : usize > ( & self ) -> ArrayWindows < ' _ , T , N > {
16311641 assert ! ( N != 0 , "window size must be non-zero" ) ;
16321642 ArrayWindows :: new ( self )
16331643 }
@@ -1660,9 +1670,10 @@ impl<T> [T] {
16601670 /// [`rchunks_exact`]: slice::rchunks_exact
16611671 /// [`chunks`]: slice::chunks
16621672 #[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1673+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
16631674 #[ inline]
16641675 #[ track_caller]
1665- pub fn rchunks ( & self , chunk_size : usize ) -> RChunks < ' _ , T > {
1676+ pub const fn rchunks ( & self , chunk_size : usize ) -> RChunks < ' _ , T > {
16661677 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
16671678 RChunks :: new ( self , chunk_size)
16681679 }
@@ -1699,9 +1710,10 @@ impl<T> [T] {
16991710 /// [`rchunks_exact_mut`]: slice::rchunks_exact_mut
17001711 /// [`chunks_mut`]: slice::chunks_mut
17011712 #[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1713+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
17021714 #[ inline]
17031715 #[ track_caller]
1704- pub fn rchunks_mut ( & mut self , chunk_size : usize ) -> RChunksMut < ' _ , T > {
1716+ pub const fn rchunks_mut ( & mut self , chunk_size : usize ) -> RChunksMut < ' _ , T > {
17051717 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
17061718 RChunksMut :: new ( self , chunk_size)
17071719 }
@@ -1739,9 +1751,10 @@ impl<T> [T] {
17391751 /// [`rchunks`]: slice::rchunks
17401752 /// [`chunks_exact`]: slice::chunks_exact
17411753 #[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1754+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
17421755 #[ inline]
17431756 #[ track_caller]
1744- pub fn rchunks_exact ( & self , chunk_size : usize ) -> RChunksExact < ' _ , T > {
1757+ pub const fn rchunks_exact ( & self , chunk_size : usize ) -> RChunksExact < ' _ , T > {
17451758 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
17461759 RChunksExact :: new ( self , chunk_size)
17471760 }
@@ -1783,9 +1796,10 @@ impl<T> [T] {
17831796 /// [`rchunks_mut`]: slice::rchunks_mut
17841797 /// [`chunks_exact_mut`]: slice::chunks_exact_mut
17851798 #[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1799+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
17861800 #[ inline]
17871801 #[ track_caller]
1788- pub fn rchunks_exact_mut ( & mut self , chunk_size : usize ) -> RChunksExactMut < ' _ , T > {
1802+ pub const fn rchunks_exact_mut ( & mut self , chunk_size : usize ) -> RChunksExactMut < ' _ , T > {
17891803 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
17901804 RChunksExactMut :: new ( self , chunk_size)
17911805 }
@@ -1823,8 +1837,9 @@ impl<T> [T] {
18231837 /// assert_eq!(iter.next(), None);
18241838 /// ```
18251839 #[ stable( feature = "slice_group_by" , since = "1.77.0" ) ]
1840+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
18261841 #[ inline]
1827- pub fn chunk_by < F > ( & self , pred : F ) -> ChunkBy < ' _ , T , F >
1842+ pub const fn chunk_by < F > ( & self , pred : F ) -> ChunkBy < ' _ , T , F >
18281843 where
18291844 F : FnMut ( & T , & T ) -> bool ,
18301845 {
@@ -1864,8 +1879,9 @@ impl<T> [T] {
18641879 /// assert_eq!(iter.next(), None);
18651880 /// ```
18661881 #[ stable( feature = "slice_group_by" , since = "1.77.0" ) ]
1882+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
18671883 #[ inline]
1868- pub fn chunk_by_mut < F > ( & mut self , pred : F ) -> ChunkByMut < ' _ , T , F >
1884+ pub const fn chunk_by_mut < F > ( & mut self , pred : F ) -> ChunkByMut < ' _ , T , F >
18691885 where
18701886 F : FnMut ( & T , & T ) -> bool ,
18711887 {
0 commit comments