From 17a1059d8343ffd66fe3f3c51e3bf9b493cdf2f3 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 10 Jun 2015 18:45:48 -0700 Subject: [PATCH] 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. --- src/libcore/iter.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 053a85a7c51..2f45ffd1418 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -3043,10 +3043,10 @@ pub fn repeat(elt: T) -> Repeat { } /// An iterator that yields nothing. -#[unstable(feature="iter_empty", reason = "new addition")] +#[stable(feature = "iter_empty", since = "1.2.0")] pub struct Empty(marker::PhantomData); -#[unstable(feature="iter_empty", reason = "new addition")] +#[stable(feature = "iter_empty", since = "1.2.0")] impl Iterator for Empty { type Item = T; @@ -3059,14 +3059,14 @@ impl Iterator for Empty { } } -#[unstable(feature="iter_empty", reason = "new addition")] +#[stable(feature = "iter_empty", since = "1.2.0")] impl DoubleEndedIterator for Empty { fn next_back(&mut self) -> Option { None } } -#[unstable(feature="iter_empty", reason = "new addition")] +#[stable(feature = "iter_empty", since = "1.2.0")] impl ExactSizeIterator for Empty { fn len(&self) -> usize { 0 @@ -3075,7 +3075,7 @@ impl ExactSizeIterator for Empty { // not #[derive] because that adds a Clone bound on T, // which isn't necessary. -#[unstable(feature="iter_empty", reason = "new addition")] +#[stable(feature = "iter_empty", since = "1.2.0")] impl Clone for Empty { fn clone(&self) -> Empty { Empty(marker::PhantomData) @@ -3084,7 +3084,7 @@ impl Clone for Empty { // not #[derive] because that adds a Default bound on T, // which isn't necessary. -#[unstable(feature="iter_empty", reason = "new addition")] +#[stable(feature = "iter_empty", since = "1.2.0")] impl Default for Empty { fn default() -> Empty { Empty(marker::PhantomData) @@ -3092,19 +3092,19 @@ impl Default for Empty { } /// Creates an iterator that yields nothing. -#[unstable(feature="iter_empty", reason = "new addition")] +#[stable(feature = "iter_empty", since = "1.2.0")] pub fn empty() -> Empty { Empty(marker::PhantomData) } /// An iterator that yields an element exactly once. #[derive(Clone)] -#[unstable(feature="iter_once", reason = "new addition")] +#[stable(feature = "iter_once", since = "1.2.0")] pub struct Once { inner: ::option::IntoIter } -#[unstable(feature="iter_once", reason = "new addition")] +#[stable(feature = "iter_once", since = "1.2.0")] impl Iterator for Once { type Item = T; @@ -3117,14 +3117,14 @@ impl Iterator for Once { } } -#[unstable(feature="iter_once", reason = "new addition")] +#[stable(feature = "iter_once", since = "1.2.0")] impl DoubleEndedIterator for Once { fn next_back(&mut self) -> Option { self.inner.next_back() } } -#[unstable(feature="iter_once", reason = "new addition")] +#[stable(feature = "iter_once", since = "1.2.0")] impl ExactSizeIterator for Once { fn len(&self) -> usize { self.inner.len() @@ -3132,7 +3132,7 @@ impl ExactSizeIterator for Once { } /// Creates an iterator that yields an element exactly once. -#[unstable(feature="iter_once", reason = "new addition")] +#[stable(feature = "iter_once", since = "1.2.0")] pub fn once(value: T) -> Once { Once { inner: Some(value).into_iter() } }