@@ -55,7 +55,7 @@ pub use self::zip::Zip;
55
55
///
56
56
/// [`FromIterator`]: crate::iter::FromIterator
57
57
/// [`as_inner`]: SourceIter::as_inner
58
- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
58
+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
59
59
pub unsafe trait SourceIter {
60
60
/// A source stage in an iterator pipeline.
61
61
type Source : Iterator ;
@@ -1010,7 +1010,7 @@ where
1010
1010
}
1011
1011
}
1012
1012
1013
- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
1013
+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
1014
1014
unsafe impl < S : Iterator , B , I : Iterator , F > SourceIter for Map < I , F >
1015
1015
where
1016
1016
F : FnMut ( I :: Item ) -> B ,
@@ -1025,7 +1025,7 @@ where
1025
1025
}
1026
1026
}
1027
1027
1028
- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
1028
+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
1029
1029
unsafe impl < B , I : InPlaceIterable , F > InPlaceIterable for Map < I , F > where F : FnMut ( I :: Item ) -> B { }
1030
1030
1031
1031
/// An iterator that filters the elements of `iter` with `predicate`.
@@ -1159,10 +1159,11 @@ where
1159
1159
#[ stable( feature = "fused" , since = "1.26.0" ) ]
1160
1160
impl < I : FusedIterator , P > FusedIterator for Filter < I , P > where P : FnMut ( & I :: Item ) -> bool { }
1161
1161
1162
- #[ unstable( issue = "0" , feature = "inplace_iteration" ) ]
1163
- unsafe impl < S : Iterator , P , I : Iterator > SourceIter for Filter < I , P > where
1162
+ #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
1163
+ unsafe impl < S : Iterator , P , I : Iterator > SourceIter for Filter < I , P >
1164
+ where
1164
1165
P : FnMut ( & I :: Item ) -> bool ,
1165
- I : SourceIter < Source = S >
1166
+ I : SourceIter < Source = S > ,
1166
1167
{
1167
1168
type Source = S ;
1168
1169
@@ -1173,9 +1174,8 @@ unsafe impl<S: Iterator, P, I: Iterator> SourceIter for Filter<I, P> where
1173
1174
}
1174
1175
}
1175
1176
1176
- #[ unstable( issue = "0" , feature = "inplace_iteration" ) ]
1177
- unsafe impl < I : InPlaceIterable , P > InPlaceIterable for Filter < I , P >
1178
- where P : FnMut ( & I :: Item ) -> bool { }
1177
+ #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
1178
+ unsafe impl < I : InPlaceIterable , P > InPlaceIterable for Filter < I , P > where P : FnMut ( & I :: Item ) -> bool { }
1179
1179
1180
1180
/// An iterator that uses `f` to both filter and map elements from `iter`.
1181
1181
///
@@ -1303,10 +1303,11 @@ where
1303
1303
#[ stable( feature = "fused" , since = "1.26.0" ) ]
1304
1304
impl < B , I : FusedIterator , F > FusedIterator for FilterMap < I , F > where F : FnMut ( I :: Item ) -> Option < B > { }
1305
1305
1306
- #[ unstable( issue = "0" , feature = "inplace_iteration" ) ]
1307
- unsafe impl < S : Iterator , B , I : Iterator , F > SourceIter for FilterMap < I , F > where
1306
+ #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
1307
+ unsafe impl < S : Iterator , B , I : Iterator , F > SourceIter for FilterMap < I , F >
1308
+ where
1308
1309
F : FnMut ( I :: Item ) -> Option < B > ,
1309
- I : SourceIter < Source = S >
1310
+ I : SourceIter < Source = S > ,
1310
1311
{
1311
1312
type Source = S ;
1312
1313
@@ -1317,10 +1318,11 @@ unsafe impl<S: Iterator, B, I: Iterator, F> SourceIter for FilterMap<I, F> where
1317
1318
}
1318
1319
}
1319
1320
1320
- #[ unstable( issue = "0" , feature = "inplace_iteration" ) ]
1321
- unsafe impl < B , I : InPlaceIterable , F > InPlaceIterable for FilterMap < I , F >
1322
- where F : FnMut ( I :: Item ) -> Option < B > { }
1323
-
1321
+ #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
1322
+ unsafe impl < B , I : InPlaceIterable , F > InPlaceIterable for FilterMap < I , F > where
1323
+ F : FnMut ( I :: Item ) -> Option < B >
1324
+ {
1325
+ }
1324
1326
1325
1327
/// An iterator that yields the current count and the element during iteration.
1326
1328
///
@@ -1540,7 +1542,7 @@ impl<I> FusedIterator for Enumerate<I> where I: FusedIterator {}
1540
1542
#[ unstable( feature = "trusted_len" , issue = "37572" ) ]
1541
1543
unsafe impl < I > TrustedLen for Enumerate < I > where I : TrustedLen { }
1542
1544
1543
- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
1545
+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
1544
1546
unsafe impl < S : Iterator , I : Iterator > SourceIter for Enumerate < I >
1545
1547
where
1546
1548
I : SourceIter < Source = S > ,
@@ -1554,7 +1556,7 @@ where
1554
1556
}
1555
1557
}
1556
1558
1557
- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
1559
+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
1558
1560
unsafe impl < I : InPlaceIterable > InPlaceIterable for Enumerate < I > { }
1559
1561
1560
1562
/// An iterator with a `peek()` that returns an optional reference to the next
@@ -1838,7 +1840,7 @@ impl<I: Iterator> Peekable<I> {
1838
1840
#[ unstable( feature = "trusted_len" , issue = "37572" ) ]
1839
1841
unsafe impl < I > TrustedLen for Peekable < I > where I : TrustedLen { }
1840
1842
1841
- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
1843
+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
1842
1844
unsafe impl < S : Iterator , I : Iterator > SourceIter for Peekable < I >
1843
1845
where
1844
1846
I : SourceIter < Source = S > ,
@@ -1852,7 +1854,7 @@ where
1852
1854
}
1853
1855
}
1854
1856
1855
- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
1857
+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
1856
1858
unsafe impl < I : InPlaceIterable > InPlaceIterable for Peekable < I > { }
1857
1859
1858
1860
/// An iterator that rejects elements while `predicate` returns `true`.
@@ -1956,10 +1958,11 @@ where
1956
1958
{
1957
1959
}
1958
1960
1959
- #[ unstable( issue = "0" , feature = "inplace_iteration" ) ]
1960
- unsafe impl < S : Iterator , P , I : Iterator > SourceIter for SkipWhile < I , P > where
1961
+ #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
1962
+ unsafe impl < S : Iterator , P , I : Iterator > SourceIter for SkipWhile < I , P >
1963
+ where
1961
1964
P : FnMut ( & I :: Item ) -> bool ,
1962
- I : SourceIter < Source = S >
1965
+ I : SourceIter < Source = S > ,
1963
1966
{
1964
1967
type Source = S ;
1965
1968
@@ -1970,9 +1973,11 @@ unsafe impl<S: Iterator, P, I: Iterator> SourceIter for SkipWhile<I, P> where
1970
1973
}
1971
1974
}
1972
1975
1973
- #[ unstable( issue = "0" , feature = "inplace_iteration" ) ]
1974
- unsafe impl < I : InPlaceIterable , F > InPlaceIterable for SkipWhile < I , F >
1975
- where F : FnMut ( & I :: Item ) -> bool { }
1976
+ #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
1977
+ unsafe impl < I : InPlaceIterable , F > InPlaceIterable for SkipWhile < I , F > where
1978
+ F : FnMut ( & I :: Item ) -> bool
1979
+ {
1980
+ }
1976
1981
1977
1982
/// An iterator that only accepts elements while `predicate` returns `true`.
1978
1983
///
@@ -2088,6 +2093,27 @@ where
2088
2093
{
2089
2094
}
2090
2095
2096
+ #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
2097
+ unsafe impl < S : Iterator , P , I : Iterator > SourceIter for TakeWhile < I , P >
2098
+ where
2099
+ P : FnMut ( & I :: Item ) -> bool ,
2100
+ I : SourceIter < Source = S > ,
2101
+ {
2102
+ type Source = S ;
2103
+
2104
+ #[ inline]
2105
+ unsafe fn as_inner ( & mut self ) -> & mut S {
2106
+ // Safety: unsafe function forwarding to unsafe function with the same requirements
2107
+ unsafe { SourceIter :: as_inner ( & mut self . iter ) }
2108
+ }
2109
+ }
2110
+
2111
+ #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
2112
+ unsafe impl < I : InPlaceIterable , F > InPlaceIterable for TakeWhile < I , F > where
2113
+ F : FnMut ( & I :: Item ) -> bool
2114
+ {
2115
+ }
2116
+
2091
2117
/// An iterator that only accepts elements while `predicate` returns `Some(_)`.
2092
2118
///
2093
2119
/// This `struct` is created by the [`map_while`] method on [`Iterator`]. See its
@@ -2165,25 +2191,6 @@ where
2165
2191
}
2166
2192
}
2167
2193
2168
- #[ unstable( issue = "0" , feature = "inplace_iteration" ) ]
2169
- unsafe impl < S : Iterator , P , I : Iterator > SourceIter for TakeWhile < I , P > where
2170
- P : FnMut ( & I :: Item ) -> bool ,
2171
- I : SourceIter < Source = S >
2172
- {
2173
- type Source = S ;
2174
-
2175
- #[ inline]
2176
- unsafe fn as_inner ( & mut self ) -> & mut S {
2177
- // Safety: unsafe function forwarding to unsafe function with the same requirements
2178
- unsafe { SourceIter :: as_inner ( & mut self . iter ) }
2179
- }
2180
- }
2181
-
2182
- #[ unstable( issue = "0" , feature = "inplace_iteration" ) ]
2183
- unsafe impl < I : InPlaceIterable , F > InPlaceIterable for TakeWhile < I , F >
2184
- where F : FnMut ( & I :: Item ) -> bool { }
2185
-
2186
-
2187
2194
/// An iterator that skips over `n` elements of `iter`.
2188
2195
///
2189
2196
/// This `struct` is created by the [`skip`] method on [`Iterator`]. See its
@@ -2367,7 +2374,7 @@ where
2367
2374
#[ stable( feature = "fused" , since = "1.26.0" ) ]
2368
2375
impl < I > FusedIterator for Skip < I > where I : FusedIterator { }
2369
2376
2370
- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
2377
+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
2371
2378
unsafe impl < S : Iterator , I : Iterator > SourceIter for Skip < I >
2372
2379
where
2373
2380
I : SourceIter < Source = S > ,
@@ -2381,7 +2388,7 @@ where
2381
2388
}
2382
2389
}
2383
2390
2384
- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
2391
+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
2385
2392
unsafe impl < I : InPlaceIterable > InPlaceIterable for Skip < I > { }
2386
2393
2387
2394
/// An iterator that only iterates over the first `n` iterations of `iter`.
@@ -2494,8 +2501,11 @@ where
2494
2501
}
2495
2502
}
2496
2503
2497
- #[ unstable( issue = "0" , feature = "inplace_iteration" ) ]
2498
- unsafe impl < S : Iterator , I : Iterator > SourceIter for Take < I > where I : SourceIter < Source = S > {
2504
+ #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
2505
+ unsafe impl < S : Iterator , I : Iterator > SourceIter for Take < I >
2506
+ where
2507
+ I : SourceIter < Source = S > ,
2508
+ {
2499
2509
type Source = S ;
2500
2510
2501
2511
#[ inline]
@@ -2505,7 +2515,7 @@ unsafe impl<S: Iterator, I: Iterator> SourceIter for Take<I> where I: SourceIter
2505
2515
}
2506
2516
}
2507
2517
2508
- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
2518
+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
2509
2519
unsafe impl < I : InPlaceIterable > InPlaceIterable for Take < I > { }
2510
2520
2511
2521
#[ stable( feature = "double_ended_take_iterator" , since = "1.38.0" ) ]
@@ -2672,10 +2682,11 @@ where
2672
2682
}
2673
2683
}
2674
2684
2675
- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
2685
+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
2676
2686
unsafe impl < St , F , B , S : Iterator , I : Iterator > SourceIter for Scan < I , St , F >
2677
- where I : SourceIter < Source = S > ,
2678
- F : FnMut ( & mut St , I :: Item ) -> Option < B > ,
2687
+ where
2688
+ I : SourceIter < Source = S > ,
2689
+ F : FnMut ( & mut St , I :: Item ) -> Option < B > ,
2679
2690
{
2680
2691
type Source = S ;
2681
2692
@@ -2686,10 +2697,11 @@ unsafe impl<St, F, B, S: Iterator, I: Iterator> SourceIter for Scan<I, St, F>
2686
2697
}
2687
2698
}
2688
2699
2689
- #[ unstable( issue = "0" , feature = "inplace_iteration" ) ]
2690
- unsafe impl < St , F , B , I : InPlaceIterable > InPlaceIterable for Scan < I , St , F >
2691
- where F : FnMut ( & mut St , I :: Item ) -> Option < B > ,
2692
- { }
2700
+ #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
2701
+ unsafe impl < St , F , B , I : InPlaceIterable > InPlaceIterable for Scan < I , St , F > where
2702
+ F : FnMut ( & mut St , I :: Item ) -> Option < B >
2703
+ {
2704
+ }
2693
2705
2694
2706
/// An iterator that calls a function with a reference to each element before
2695
2707
/// yielding it.
@@ -2837,10 +2849,11 @@ where
2837
2849
#[ stable( feature = "fused" , since = "1.26.0" ) ]
2838
2850
impl < I : FusedIterator , F > FusedIterator for Inspect < I , F > where F : FnMut ( & I :: Item ) { }
2839
2851
2840
- #[ unstable( issue = "0" , feature = "inplace_iteration" ) ]
2841
- unsafe impl < S : Iterator , I : Iterator , F > SourceIter for Inspect < I , F > where
2852
+ #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
2853
+ unsafe impl < S : Iterator , I : Iterator , F > SourceIter for Inspect < I , F >
2854
+ where
2842
2855
F : FnMut ( & I :: Item ) ,
2843
- I : SourceIter < Source = S >
2856
+ I : SourceIter < Source = S > ,
2844
2857
{
2845
2858
type Source = S ;
2846
2859
@@ -2851,8 +2864,8 @@ unsafe impl<S: Iterator, I: Iterator, F> SourceIter for Inspect<I, F> where
2851
2864
}
2852
2865
}
2853
2866
2854
- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
2855
- unsafe impl < I : InPlaceIterable , F > InPlaceIterable for Inspect < I , F > where F : FnMut ( & I :: Item ) { }
2867
+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
2868
+ unsafe impl < I : InPlaceIterable , F > InPlaceIterable for Inspect < I , F > where F : FnMut ( & I :: Item ) { }
2856
2869
2857
2870
/// An iterator adapter that produces output as long as the underlying
2858
2871
/// iterator produces `Result::Ok` values.
0 commit comments