@@ -55,7 +55,7 @@ pub use self::zip::Zip;
5555///
5656/// [`FromIterator`]: crate::iter::FromIterator
5757/// [`as_inner`]: SourceIter::as_inner
58- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
58+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
5959pub unsafe trait SourceIter {
6060 /// A source stage in an iterator pipeline.
6161 type Source : Iterator ;
@@ -1010,7 +1010,7 @@ where
10101010 }
10111011}
10121012
1013- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
1013+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
10141014unsafe impl < S : Iterator , B , I : Iterator , F > SourceIter for Map < I , F >
10151015where
10161016 F : FnMut ( I :: Item ) -> B ,
@@ -1025,7 +1025,7 @@ where
10251025 }
10261026}
10271027
1028- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
1028+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
10291029unsafe impl < B , I : InPlaceIterable , F > InPlaceIterable for Map < I , F > where F : FnMut ( I :: Item ) -> B { }
10301030
10311031/// An iterator that filters the elements of `iter` with `predicate`.
@@ -1159,10 +1159,11 @@ where
11591159#[ stable( feature = "fused" , since = "1.26.0" ) ]
11601160impl < I : FusedIterator , P > FusedIterator for Filter < I , P > where P : FnMut ( & I :: Item ) -> bool { }
11611161
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
11641165 P : FnMut ( & I :: Item ) -> bool ,
1165- I : SourceIter < Source = S >
1166+ I : SourceIter < Source = S > ,
11661167{
11671168 type Source = S ;
11681169
@@ -1173,9 +1174,8 @@ unsafe impl<S: Iterator, P, I: Iterator> SourceIter for Filter<I, P> where
11731174 }
11741175}
11751176
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 { }
11791179
11801180/// An iterator that uses `f` to both filter and map elements from `iter`.
11811181///
@@ -1303,10 +1303,11 @@ where
13031303#[ stable( feature = "fused" , since = "1.26.0" ) ]
13041304impl < B , I : FusedIterator , F > FusedIterator for FilterMap < I , F > where F : FnMut ( I :: Item ) -> Option < B > { }
13051305
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
13081309 F : FnMut ( I :: Item ) -> Option < B > ,
1309- I : SourceIter < Source = S >
1310+ I : SourceIter < Source = S > ,
13101311{
13111312 type Source = S ;
13121313
@@ -1317,10 +1318,11 @@ unsafe impl<S: Iterator, B, I: Iterator, F> SourceIter for FilterMap<I, F> where
13171318 }
13181319}
13191320
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+ }
13241326
13251327/// An iterator that yields the current count and the element during iteration.
13261328///
@@ -1540,7 +1542,7 @@ impl<I> FusedIterator for Enumerate<I> where I: FusedIterator {}
15401542#[ unstable( feature = "trusted_len" , issue = "37572" ) ]
15411543unsafe impl < I > TrustedLen for Enumerate < I > where I : TrustedLen { }
15421544
1543- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
1545+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
15441546unsafe impl < S : Iterator , I : Iterator > SourceIter for Enumerate < I >
15451547where
15461548 I : SourceIter < Source = S > ,
@@ -1554,7 +1556,7 @@ where
15541556 }
15551557}
15561558
1557- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
1559+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
15581560unsafe impl < I : InPlaceIterable > InPlaceIterable for Enumerate < I > { }
15591561
15601562/// An iterator with a `peek()` that returns an optional reference to the next
@@ -1838,7 +1840,7 @@ impl<I: Iterator> Peekable<I> {
18381840#[ unstable( feature = "trusted_len" , issue = "37572" ) ]
18391841unsafe impl < I > TrustedLen for Peekable < I > where I : TrustedLen { }
18401842
1841- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
1843+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
18421844unsafe impl < S : Iterator , I : Iterator > SourceIter for Peekable < I >
18431845where
18441846 I : SourceIter < Source = S > ,
@@ -1852,7 +1854,7 @@ where
18521854 }
18531855}
18541856
1855- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
1857+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
18561858unsafe impl < I : InPlaceIterable > InPlaceIterable for Peekable < I > { }
18571859
18581860/// An iterator that rejects elements while `predicate` returns `true`.
@@ -1956,10 +1958,11 @@ where
19561958{
19571959}
19581960
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
19611964 P : FnMut ( & I :: Item ) -> bool ,
1962- I : SourceIter < Source = S >
1965+ I : SourceIter < Source = S > ,
19631966{
19641967 type Source = S ;
19651968
@@ -1970,9 +1973,11 @@ unsafe impl<S: Iterator, P, I: Iterator> SourceIter for SkipWhile<I, P> where
19701973 }
19711974}
19721975
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+ }
19761981
19771982/// An iterator that only accepts elements while `predicate` returns `true`.
19781983///
@@ -2088,6 +2093,27 @@ where
20882093{
20892094}
20902095
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+
20912117/// An iterator that only accepts elements while `predicate` returns `Some(_)`.
20922118///
20932119/// This `struct` is created by the [`map_while`] method on [`Iterator`]. See its
@@ -2165,25 +2191,6 @@ where
21652191 }
21662192}
21672193
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-
21872194/// An iterator that skips over `n` elements of `iter`.
21882195///
21892196/// This `struct` is created by the [`skip`] method on [`Iterator`]. See its
@@ -2367,7 +2374,7 @@ where
23672374#[ stable( feature = "fused" , since = "1.26.0" ) ]
23682375impl < I > FusedIterator for Skip < I > where I : FusedIterator { }
23692376
2370- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
2377+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
23712378unsafe impl < S : Iterator , I : Iterator > SourceIter for Skip < I >
23722379where
23732380 I : SourceIter < Source = S > ,
@@ -2381,7 +2388,7 @@ where
23812388 }
23822389}
23832390
2384- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
2391+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
23852392unsafe impl < I : InPlaceIterable > InPlaceIterable for Skip < I > { }
23862393
23872394/// An iterator that only iterates over the first `n` iterations of `iter`.
@@ -2494,8 +2501,11 @@ where
24942501 }
24952502}
24962503
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+ {
24992509 type Source = S ;
25002510
25012511 #[ inline]
@@ -2505,7 +2515,7 @@ unsafe impl<S: Iterator, I: Iterator> SourceIter for Take<I> where I: SourceIter
25052515 }
25062516}
25072517
2508- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
2518+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
25092519unsafe impl < I : InPlaceIterable > InPlaceIterable for Take < I > { }
25102520
25112521#[ stable( feature = "double_ended_take_iterator" , since = "1.38.0" ) ]
@@ -2672,10 +2682,11 @@ where
26722682 }
26732683}
26742684
2675- #[ unstable( issue = "0 " , feature = "inplace_iteration" ) ]
2685+ #[ unstable( issue = "none " , feature = "inplace_iteration" ) ]
26762686unsafe 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 > ,
26792690{
26802691 type Source = S ;
26812692
@@ -2686,10 +2697,11 @@ unsafe impl<St, F, B, S: Iterator, I: Iterator> SourceIter for Scan<I, St, F>
26862697 }
26872698}
26882699
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+ }
26932705
26942706/// An iterator that calls a function with a reference to each element before
26952707/// yielding it.
@@ -2837,10 +2849,11 @@ where
28372849#[ stable( feature = "fused" , since = "1.26.0" ) ]
28382850impl < I : FusedIterator , F > FusedIterator for Inspect < I , F > where F : FnMut ( & I :: Item ) { }
28392851
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
28422855 F : FnMut ( & I :: Item ) ,
2843- I : SourceIter < Source = S >
2856+ I : SourceIter < Source = S > ,
28442857{
28452858 type Source = S ;
28462859
@@ -2851,8 +2864,8 @@ unsafe impl<S: Iterator, I: Iterator, F> SourceIter for Inspect<I, F> where
28512864 }
28522865}
28532866
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 ) { }
28562869
28572870/// An iterator adapter that produces output as long as the underlying
28582871/// iterator produces `Result::Ok` values.
0 commit comments