Skip to content

Commit 17a1059

Browse files
committed
std: Stabilize the iter_{once,empty} features
This commit stabilizes these two iterator primitives as they have gone through the RFC process and had some time to bake now.
1 parent f358087 commit 17a1059

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/libcore/iter.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3043,10 +3043,10 @@ pub fn repeat<T: Clone>(elt: T) -> Repeat<T> {
30433043
}
30443044

30453045
/// An iterator that yields nothing.
3046-
#[unstable(feature="iter_empty", reason = "new addition")]
3046+
#[stable(feature = "iter_empty", since = "1.2.0")]
30473047
pub struct Empty<T>(marker::PhantomData<T>);
30483048

3049-
#[unstable(feature="iter_empty", reason = "new addition")]
3049+
#[stable(feature = "iter_empty", since = "1.2.0")]
30503050
impl<T> Iterator for Empty<T> {
30513051
type Item = T;
30523052

@@ -3059,14 +3059,14 @@ impl<T> Iterator for Empty<T> {
30593059
}
30603060
}
30613061

3062-
#[unstable(feature="iter_empty", reason = "new addition")]
3062+
#[stable(feature = "iter_empty", since = "1.2.0")]
30633063
impl<T> DoubleEndedIterator for Empty<T> {
30643064
fn next_back(&mut self) -> Option<T> {
30653065
None
30663066
}
30673067
}
30683068

3069-
#[unstable(feature="iter_empty", reason = "new addition")]
3069+
#[stable(feature = "iter_empty", since = "1.2.0")]
30703070
impl<T> ExactSizeIterator for Empty<T> {
30713071
fn len(&self) -> usize {
30723072
0
@@ -3075,7 +3075,7 @@ impl<T> ExactSizeIterator for Empty<T> {
30753075

30763076
// not #[derive] because that adds a Clone bound on T,
30773077
// which isn't necessary.
3078-
#[unstable(feature="iter_empty", reason = "new addition")]
3078+
#[stable(feature = "iter_empty", since = "1.2.0")]
30793079
impl<T> Clone for Empty<T> {
30803080
fn clone(&self) -> Empty<T> {
30813081
Empty(marker::PhantomData)
@@ -3084,27 +3084,27 @@ impl<T> Clone for Empty<T> {
30843084

30853085
// not #[derive] because that adds a Default bound on T,
30863086
// which isn't necessary.
3087-
#[unstable(feature="iter_empty", reason = "new addition")]
3087+
#[stable(feature = "iter_empty", since = "1.2.0")]
30883088
impl<T> Default for Empty<T> {
30893089
fn default() -> Empty<T> {
30903090
Empty(marker::PhantomData)
30913091
}
30923092
}
30933093

30943094
/// Creates an iterator that yields nothing.
3095-
#[unstable(feature="iter_empty", reason = "new addition")]
3095+
#[stable(feature = "iter_empty", since = "1.2.0")]
30963096
pub fn empty<T>() -> Empty<T> {
30973097
Empty(marker::PhantomData)
30983098
}
30993099

31003100
/// An iterator that yields an element exactly once.
31013101
#[derive(Clone)]
3102-
#[unstable(feature="iter_once", reason = "new addition")]
3102+
#[stable(feature = "iter_once", since = "1.2.0")]
31033103
pub struct Once<T> {
31043104
inner: ::option::IntoIter<T>
31053105
}
31063106

3107-
#[unstable(feature="iter_once", reason = "new addition")]
3107+
#[stable(feature = "iter_once", since = "1.2.0")]
31083108
impl<T> Iterator for Once<T> {
31093109
type Item = T;
31103110

@@ -3117,22 +3117,22 @@ impl<T> Iterator for Once<T> {
31173117
}
31183118
}
31193119

3120-
#[unstable(feature="iter_once", reason = "new addition")]
3120+
#[stable(feature = "iter_once", since = "1.2.0")]
31213121
impl<T> DoubleEndedIterator for Once<T> {
31223122
fn next_back(&mut self) -> Option<T> {
31233123
self.inner.next_back()
31243124
}
31253125
}
31263126

3127-
#[unstable(feature="iter_once", reason = "new addition")]
3127+
#[stable(feature = "iter_once", since = "1.2.0")]
31283128
impl<T> ExactSizeIterator for Once<T> {
31293129
fn len(&self) -> usize {
31303130
self.inner.len()
31313131
}
31323132
}
31333133

31343134
/// Creates an iterator that yields an element exactly once.
3135-
#[unstable(feature="iter_once", reason = "new addition")]
3135+
#[stable(feature = "iter_once", since = "1.2.0")]
31363136
pub fn once<T>(value: T) -> Once<T> {
31373137
Once { inner: Some(value).into_iter() }
31383138
}

0 commit comments

Comments
 (0)