@@ -1045,9 +1045,10 @@ impl<T> [T] {
10451045 /// assert_eq!(iterator.next(), None);
10461046 /// ```
10471047 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1048+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
10481049 #[ inline]
10491050 #[ cfg_attr( not( test) , rustc_diagnostic_item = "slice_iter" ) ]
1050- pub fn iter ( & self ) -> Iter < ' _ , T > {
1051+ pub const fn iter ( & self ) -> Iter < ' _ , T > {
10511052 Iter :: new ( self )
10521053 }
10531054
@@ -1064,9 +1065,10 @@ impl<T> [T] {
10641065 /// }
10651066 /// assert_eq!(x, &[3, 4, 6]);
10661067 /// ```
1068+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
10671069 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
10681070 #[ inline]
1069- pub fn iter_mut ( & mut self ) -> IterMut < ' _ , T > {
1071+ pub const fn iter_mut ( & mut self ) -> IterMut < ' _ , T > {
10701072 IterMut :: new ( self )
10711073 }
10721074
@@ -1118,9 +1120,10 @@ impl<T> [T] {
11181120 /// assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
11191121 /// ```
11201122 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1123+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
11211124 #[ inline]
11221125 #[ track_caller]
1123- pub fn windows ( & self , size : usize ) -> Windows < ' _ , T > {
1126+ pub const fn windows ( & self , size : usize ) -> Windows < ' _ , T > {
11241127 let size = NonZero :: new ( size) . expect ( "window size must be non-zero" ) ;
11251128 Windows :: new ( self , size)
11261129 }
@@ -1153,9 +1156,10 @@ impl<T> [T] {
11531156 /// [`chunks_exact`]: slice::chunks_exact
11541157 /// [`rchunks`]: slice::rchunks
11551158 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1159+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
11561160 #[ inline]
11571161 #[ track_caller]
1158- pub fn chunks ( & self , chunk_size : usize ) -> Chunks < ' _ , T > {
1162+ pub const fn chunks ( & self , chunk_size : usize ) -> Chunks < ' _ , T > {
11591163 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
11601164 Chunks :: new ( self , chunk_size)
11611165 }
@@ -1192,9 +1196,10 @@ impl<T> [T] {
11921196 /// [`chunks_exact_mut`]: slice::chunks_exact_mut
11931197 /// [`rchunks_mut`]: slice::rchunks_mut
11941198 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1199+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
11951200 #[ inline]
11961201 #[ track_caller]
1197- pub fn chunks_mut ( & mut self , chunk_size : usize ) -> ChunksMut < ' _ , T > {
1202+ pub const fn chunks_mut ( & mut self , chunk_size : usize ) -> ChunksMut < ' _ , T > {
11981203 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
11991204 ChunksMut :: new ( self , chunk_size)
12001205 }
@@ -1230,9 +1235,10 @@ impl<T> [T] {
12301235 /// [`chunks`]: slice::chunks
12311236 /// [`rchunks_exact`]: slice::rchunks_exact
12321237 #[ stable( feature = "chunks_exact" , since = "1.31.0" ) ]
1238+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
12331239 #[ inline]
12341240 #[ track_caller]
1235- pub fn chunks_exact ( & self , chunk_size : usize ) -> ChunksExact < ' _ , T > {
1241+ pub const fn chunks_exact ( & self , chunk_size : usize ) -> ChunksExact < ' _ , T > {
12361242 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
12371243 ChunksExact :: new ( self , chunk_size)
12381244 }
@@ -1273,9 +1279,10 @@ impl<T> [T] {
12731279 /// [`chunks_mut`]: slice::chunks_mut
12741280 /// [`rchunks_exact_mut`]: slice::rchunks_exact_mut
12751281 #[ stable( feature = "chunks_exact" , since = "1.31.0" ) ]
1282+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
12761283 #[ inline]
12771284 #[ track_caller]
1278- pub fn chunks_exact_mut ( & mut self , chunk_size : usize ) -> ChunksExactMut < ' _ , T > {
1285+ pub const fn chunks_exact_mut ( & mut self , chunk_size : usize ) -> ChunksExactMut < ' _ , T > {
12791286 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
12801287 ChunksExactMut :: new ( self , chunk_size)
12811288 }
@@ -1431,9 +1438,10 @@ impl<T> [T] {
14311438 ///
14321439 /// [`chunks_exact`]: slice::chunks_exact
14331440 #[ unstable( feature = "array_chunks" , issue = "74985" ) ]
1441+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
14341442 #[ inline]
14351443 #[ track_caller]
1436- pub fn array_chunks < const N : usize > ( & self ) -> ArrayChunks < ' _ , T , N > {
1444+ pub const fn array_chunks < const N : usize > ( & self ) -> ArrayChunks < ' _ , T , N > {
14371445 assert ! ( N != 0 , "chunk size must be non-zero" ) ;
14381446 ArrayChunks :: new ( self )
14391447 }
@@ -1594,9 +1602,10 @@ impl<T> [T] {
15941602 ///
15951603 /// [`chunks_exact_mut`]: slice::chunks_exact_mut
15961604 #[ unstable( feature = "array_chunks" , issue = "74985" ) ]
1605+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
15971606 #[ inline]
15981607 #[ track_caller]
1599- pub fn array_chunks_mut < const N : usize > ( & mut self ) -> ArrayChunksMut < ' _ , T , N > {
1608+ pub const fn array_chunks_mut < const N : usize > ( & mut self ) -> ArrayChunksMut < ' _ , T , N > {
16001609 assert ! ( N != 0 , "chunk size must be non-zero" ) ;
16011610 ArrayChunksMut :: new ( self )
16021611 }
@@ -1627,9 +1636,10 @@ impl<T> [T] {
16271636 ///
16281637 /// [`windows`]: slice::windows
16291638 #[ unstable( feature = "array_windows" , issue = "75027" ) ]
1639+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
16301640 #[ inline]
16311641 #[ track_caller]
1632- pub fn array_windows < const N : usize > ( & self ) -> ArrayWindows < ' _ , T , N > {
1642+ pub const fn array_windows < const N : usize > ( & self ) -> ArrayWindows < ' _ , T , N > {
16331643 assert ! ( N != 0 , "window size must be non-zero" ) ;
16341644 ArrayWindows :: new ( self )
16351645 }
@@ -1662,9 +1672,10 @@ impl<T> [T] {
16621672 /// [`rchunks_exact`]: slice::rchunks_exact
16631673 /// [`chunks`]: slice::chunks
16641674 #[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1675+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
16651676 #[ inline]
16661677 #[ track_caller]
1667- pub fn rchunks ( & self , chunk_size : usize ) -> RChunks < ' _ , T > {
1678+ pub const fn rchunks ( & self , chunk_size : usize ) -> RChunks < ' _ , T > {
16681679 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
16691680 RChunks :: new ( self , chunk_size)
16701681 }
@@ -1701,9 +1712,10 @@ impl<T> [T] {
17011712 /// [`rchunks_exact_mut`]: slice::rchunks_exact_mut
17021713 /// [`chunks_mut`]: slice::chunks_mut
17031714 #[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1715+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
17041716 #[ inline]
17051717 #[ track_caller]
1706- pub fn rchunks_mut ( & mut self , chunk_size : usize ) -> RChunksMut < ' _ , T > {
1718+ pub const fn rchunks_mut ( & mut self , chunk_size : usize ) -> RChunksMut < ' _ , T > {
17071719 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
17081720 RChunksMut :: new ( self , chunk_size)
17091721 }
@@ -1741,9 +1753,10 @@ impl<T> [T] {
17411753 /// [`rchunks`]: slice::rchunks
17421754 /// [`chunks_exact`]: slice::chunks_exact
17431755 #[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1756+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
17441757 #[ inline]
17451758 #[ track_caller]
1746- pub fn rchunks_exact ( & self , chunk_size : usize ) -> RChunksExact < ' _ , T > {
1759+ pub const fn rchunks_exact ( & self , chunk_size : usize ) -> RChunksExact < ' _ , T > {
17471760 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
17481761 RChunksExact :: new ( self , chunk_size)
17491762 }
@@ -1785,9 +1798,10 @@ impl<T> [T] {
17851798 /// [`rchunks_mut`]: slice::rchunks_mut
17861799 /// [`chunks_exact_mut`]: slice::chunks_exact_mut
17871800 #[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1801+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
17881802 #[ inline]
17891803 #[ track_caller]
1790- pub fn rchunks_exact_mut ( & mut self , chunk_size : usize ) -> RChunksExactMut < ' _ , T > {
1804+ pub const fn rchunks_exact_mut ( & mut self , chunk_size : usize ) -> RChunksExactMut < ' _ , T > {
17911805 assert ! ( chunk_size != 0 , "chunk size must be non-zero" ) ;
17921806 RChunksExactMut :: new ( self , chunk_size)
17931807 }
@@ -1825,8 +1839,9 @@ impl<T> [T] {
18251839 /// assert_eq!(iter.next(), None);
18261840 /// ```
18271841 #[ stable( feature = "slice_group_by" , since = "1.77.0" ) ]
1842+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
18281843 #[ inline]
1829- pub fn chunk_by < F > ( & self , pred : F ) -> ChunkBy < ' _ , T , F >
1844+ pub const fn chunk_by < F > ( & self , pred : F ) -> ChunkBy < ' _ , T , F >
18301845 where
18311846 F : FnMut ( & T , & T ) -> bool ,
18321847 {
@@ -1866,8 +1881,9 @@ impl<T> [T] {
18661881 /// assert_eq!(iter.next(), None);
18671882 /// ```
18681883 #[ stable( feature = "slice_group_by" , since = "1.77.0" ) ]
1884+ #[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
18691885 #[ inline]
1870- pub fn chunk_by_mut < F > ( & mut self , pred : F ) -> ChunkByMut < ' _ , T , F >
1886+ pub const fn chunk_by_mut < F > ( & mut self , pred : F ) -> ChunkByMut < ' _ , T , F >
18711887 where
18721888 F : FnMut ( & T , & T ) -> bool ,
18731889 {
0 commit comments