@@ -1305,9 +1305,7 @@ impl<T> FusedIterator for Windows<'_, T> {}
13051305#[ doc( hidden) ]
13061306#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
13071307unsafe impl < ' a , T > TrustedRandomAccess for Windows < ' a , T > {
1308- fn may_have_side_effect ( ) -> bool {
1309- false
1310- }
1308+ const MAY_HAVE_SIDE_EFFECT : bool = false ;
13111309}
13121310
13131311/// An iterator over a slice in (non-overlapping) chunks (`chunk_size` elements at a
@@ -1473,9 +1471,7 @@ impl<T> FusedIterator for Chunks<'_, T> {}
14731471#[ doc( hidden) ]
14741472#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
14751473unsafe impl < ' a , T > TrustedRandomAccess for Chunks < ' a , T > {
1476- fn may_have_side_effect ( ) -> bool {
1477- false
1478- }
1474+ const MAY_HAVE_SIDE_EFFECT : bool = false ;
14791475}
14801476
14811477/// An iterator over a slice in (non-overlapping) mutable chunks (`chunk_size`
@@ -1638,9 +1634,7 @@ impl<T> FusedIterator for ChunksMut<'_, T> {}
16381634#[ doc( hidden) ]
16391635#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
16401636unsafe impl < ' a , T > TrustedRandomAccess for ChunksMut < ' a , T > {
1641- fn may_have_side_effect ( ) -> bool {
1642- false
1643- }
1637+ const MAY_HAVE_SIDE_EFFECT : bool = false ;
16441638}
16451639
16461640/// An iterator over a slice in (non-overlapping) chunks (`chunk_size` elements at a
@@ -1794,9 +1788,7 @@ impl<T> FusedIterator for ChunksExact<'_, T> {}
17941788#[ doc( hidden) ]
17951789#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
17961790unsafe impl < ' a , T > TrustedRandomAccess for ChunksExact < ' a , T > {
1797- fn may_have_side_effect ( ) -> bool {
1798- false
1799- }
1791+ const MAY_HAVE_SIDE_EFFECT : bool = false ;
18001792}
18011793
18021794/// An iterator over a slice in (non-overlapping) mutable chunks (`chunk_size`
@@ -1947,9 +1939,7 @@ impl<T> FusedIterator for ChunksExactMut<'_, T> {}
19471939#[ doc( hidden) ]
19481940#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
19491941unsafe impl < ' a , T > TrustedRandomAccess for ChunksExactMut < ' a , T > {
1950- fn may_have_side_effect ( ) -> bool {
1951- false
1952- }
1942+ const MAY_HAVE_SIDE_EFFECT : bool = false ;
19531943}
19541944
19551945/// A windowed iterator over a slice in overlapping chunks (`N` elements at a
@@ -2186,9 +2176,7 @@ impl<T, const N: usize> FusedIterator for ArrayChunks<'_, T, N> {}
21862176#[ doc( hidden) ]
21872177#[ unstable( feature = "array_chunks" , issue = "74985" ) ]
21882178unsafe impl < ' a , T , const N : usize > TrustedRandomAccess for ArrayChunks < ' a , T , N > {
2189- fn may_have_side_effect ( ) -> bool {
2190- false
2191- }
2179+ const MAY_HAVE_SIDE_EFFECT : bool = false ;
21922180}
21932181
21942182/// An iterator over a slice in (non-overlapping) mutable chunks (`N` elements
@@ -2300,9 +2288,7 @@ impl<T, const N: usize> FusedIterator for ArrayChunksMut<'_, T, N> {}
23002288#[ doc( hidden) ]
23012289#[ unstable( feature = "array_chunks" , issue = "74985" ) ]
23022290unsafe impl < ' a , T , const N : usize > TrustedRandomAccess for ArrayChunksMut < ' a , T , N > {
2303- fn may_have_side_effect ( ) -> bool {
2304- false
2305- }
2291+ const MAY_HAVE_SIDE_EFFECT : bool = false ;
23062292}
23072293
23082294/// An iterator over a slice in (non-overlapping) chunks (`chunk_size` elements at a
@@ -2464,9 +2450,7 @@ impl<T> FusedIterator for RChunks<'_, T> {}
24642450#[ doc( hidden) ]
24652451#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
24662452unsafe impl < ' a , T > TrustedRandomAccess for RChunks < ' a , T > {
2467- fn may_have_side_effect ( ) -> bool {
2468- false
2469- }
2453+ const MAY_HAVE_SIDE_EFFECT : bool = false ;
24702454}
24712455
24722456/// An iterator over a slice in (non-overlapping) mutable chunks (`chunk_size`
@@ -2627,9 +2611,7 @@ impl<T> FusedIterator for RChunksMut<'_, T> {}
26272611#[ doc( hidden) ]
26282612#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
26292613unsafe impl < ' a , T > TrustedRandomAccess for RChunksMut < ' a , T > {
2630- fn may_have_side_effect ( ) -> bool {
2631- false
2632- }
2614+ const MAY_HAVE_SIDE_EFFECT : bool = false ;
26332615}
26342616
26352617/// An iterator over a slice in (non-overlapping) chunks (`chunk_size` elements at a
@@ -2787,9 +2769,7 @@ impl<T> FusedIterator for RChunksExact<'_, T> {}
27872769#[ doc( hidden) ]
27882770#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
27892771unsafe impl < ' a , T > TrustedRandomAccess for RChunksExact < ' a , T > {
2790- fn may_have_side_effect ( ) -> bool {
2791- false
2792- }
2772+ const MAY_HAVE_SIDE_EFFECT : bool = false ;
27932773}
27942774
27952775/// An iterator over a slice in (non-overlapping) mutable chunks (`chunk_size`
@@ -2944,25 +2924,19 @@ impl<T> FusedIterator for RChunksExactMut<'_, T> {}
29442924#[ doc( hidden) ]
29452925#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
29462926unsafe impl < ' a , T > TrustedRandomAccess for RChunksExactMut < ' a , T > {
2947- fn may_have_side_effect ( ) -> bool {
2948- false
2949- }
2927+ const MAY_HAVE_SIDE_EFFECT : bool = false ;
29502928}
29512929
29522930#[ doc( hidden) ]
29532931#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
29542932unsafe impl < ' a , T > TrustedRandomAccess for Iter < ' a , T > {
2955- fn may_have_side_effect ( ) -> bool {
2956- false
2957- }
2933+ const MAY_HAVE_SIDE_EFFECT : bool = false ;
29582934}
29592935
29602936#[ doc( hidden) ]
29612937#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
29622938unsafe impl < ' a , T > TrustedRandomAccess for IterMut < ' a , T > {
2963- fn may_have_side_effect ( ) -> bool {
2964- false
2965- }
2939+ const MAY_HAVE_SIDE_EFFECT : bool = false ;
29662940}
29672941
29682942/// An iterator over slice in (non-overlapping) chunks separated by a predicate.
0 commit comments