@@ -1305,9 +1305,7 @@ impl<T> FusedIterator for Windows<'_, T> {}
1305
1305
#[ doc( hidden) ]
1306
1306
#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
1307
1307
unsafe 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 ;
1311
1309
}
1312
1310
1313
1311
/// An iterator over a slice in (non-overlapping) chunks (`chunk_size` elements at a
@@ -1473,9 +1471,7 @@ impl<T> FusedIterator for Chunks<'_, T> {}
1473
1471
#[ doc( hidden) ]
1474
1472
#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
1475
1473
unsafe 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 ;
1479
1475
}
1480
1476
1481
1477
/// An iterator over a slice in (non-overlapping) mutable chunks (`chunk_size`
@@ -1638,9 +1634,7 @@ impl<T> FusedIterator for ChunksMut<'_, T> {}
1638
1634
#[ doc( hidden) ]
1639
1635
#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
1640
1636
unsafe 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 ;
1644
1638
}
1645
1639
1646
1640
/// An iterator over a slice in (non-overlapping) chunks (`chunk_size` elements at a
@@ -1794,9 +1788,7 @@ impl<T> FusedIterator for ChunksExact<'_, T> {}
1794
1788
#[ doc( hidden) ]
1795
1789
#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
1796
1790
unsafe 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 ;
1800
1792
}
1801
1793
1802
1794
/// An iterator over a slice in (non-overlapping) mutable chunks (`chunk_size`
@@ -1947,9 +1939,7 @@ impl<T> FusedIterator for ChunksExactMut<'_, T> {}
1947
1939
#[ doc( hidden) ]
1948
1940
#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
1949
1941
unsafe 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 ;
1953
1943
}
1954
1944
1955
1945
/// 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> {}
2186
2176
#[ doc( hidden) ]
2187
2177
#[ unstable( feature = "array_chunks" , issue = "74985" ) ]
2188
2178
unsafe 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 ;
2192
2180
}
2193
2181
2194
2182
/// 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> {}
2300
2288
#[ doc( hidden) ]
2301
2289
#[ unstable( feature = "array_chunks" , issue = "74985" ) ]
2302
2290
unsafe 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 ;
2306
2292
}
2307
2293
2308
2294
/// An iterator over a slice in (non-overlapping) chunks (`chunk_size` elements at a
@@ -2464,9 +2450,7 @@ impl<T> FusedIterator for RChunks<'_, T> {}
2464
2450
#[ doc( hidden) ]
2465
2451
#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
2466
2452
unsafe 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 ;
2470
2454
}
2471
2455
2472
2456
/// An iterator over a slice in (non-overlapping) mutable chunks (`chunk_size`
@@ -2627,9 +2611,7 @@ impl<T> FusedIterator for RChunksMut<'_, T> {}
2627
2611
#[ doc( hidden) ]
2628
2612
#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
2629
2613
unsafe 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 ;
2633
2615
}
2634
2616
2635
2617
/// An iterator over a slice in (non-overlapping) chunks (`chunk_size` elements at a
@@ -2787,9 +2769,7 @@ impl<T> FusedIterator for RChunksExact<'_, T> {}
2787
2769
#[ doc( hidden) ]
2788
2770
#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
2789
2771
unsafe 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 ;
2793
2773
}
2794
2774
2795
2775
/// An iterator over a slice in (non-overlapping) mutable chunks (`chunk_size`
@@ -2944,25 +2924,19 @@ impl<T> FusedIterator for RChunksExactMut<'_, T> {}
2944
2924
#[ doc( hidden) ]
2945
2925
#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
2946
2926
unsafe 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 ;
2950
2928
}
2951
2929
2952
2930
#[ doc( hidden) ]
2953
2931
#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
2954
2932
unsafe 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 ;
2958
2934
}
2959
2935
2960
2936
#[ doc( hidden) ]
2961
2937
#[ unstable( feature = "trusted_random_access" , issue = "none" ) ]
2962
2938
unsafe 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 ;
2966
2940
}
2967
2941
2968
2942
/// An iterator over slice in (non-overlapping) chunks separated by a predicate.
0 commit comments