about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorThayne McCombs <astrothayne@gmail.com>2018-06-02 20:42:42 -0600
committerThayne McCombs <astrothayne@gmail.com>2018-06-02 20:42:42 -0600
commit72e17b81fa88894e3fe04f221166f5a48e753e94 (patch)
tree648cb04971542bfa2f5e1e86f5a0d03cb9340c2f /src/libcore
parent4ecf12bf0eb8386626ccdb5f721a7183ccc4eba6 (diff)
downloadrust-72e17b81fa88894e3fe04f221166f5a48e753e94.tar.gz
rust-72e17b81fa88894e3fe04f221166f5a48e753e94.zip
Stabilize Iterator::step_by
Fixes #27741
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/iter/iterator.rs5
-rw-r--r--src/libcore/iter/mod.rs12
-rw-r--r--src/libcore/tests/lib.rs1
3 files changed, 4 insertions, 14 deletions
diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs
index f5b23a3793b..1972b009905 100644
--- a/src/libcore/iter/iterator.rs
+++ b/src/libcore/iter/iterator.rs
@@ -283,7 +283,6 @@ pub trait Iterator {
     /// Basic usage:
     ///
     /// ```
-    /// #![feature(iterator_step_by)]
     /// let a = [0, 1, 2, 3, 4, 5];
     /// let mut iter = a.into_iter().step_by(2);
     ///
@@ -293,9 +292,7 @@ pub trait Iterator {
     /// assert_eq!(iter.next(), None);
     /// ```
     #[inline]
-    #[unstable(feature = "iterator_step_by",
-               reason = "unstable replacement of Range::step_by",
-               issue = "27741")]
+    #[stable(feature = "iterator_step_by", since = "1.28.0")]
     fn step_by(self, step: usize) -> StepBy<Self> where Self: Sized {
         assert!(step != 0);
         StepBy{iter: self, step: step - 1, first_take: true}
diff --git a/src/libcore/iter/mod.rs b/src/libcore/iter/mod.rs
index 1e8476d3880..3458527c322 100644
--- a/src/libcore/iter/mod.rs
+++ b/src/libcore/iter/mod.rs
@@ -673,9 +673,7 @@ impl<I> FusedIterator for Cycle<I> where I: Clone + Iterator {}
 /// [`step_by`]: trait.Iterator.html#method.step_by
 /// [`Iterator`]: trait.Iterator.html
 #[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
-#[unstable(feature = "iterator_step_by",
-           reason = "unstable replacement of Range::step_by",
-           issue = "27741")]
+#[stable(feature = "iterator_step_by", since = "1.28.0")]
 #[derive(Clone, Debug)]
 pub struct StepBy<I> {
     iter: I,
@@ -683,9 +681,7 @@ pub struct StepBy<I> {
     first_take: bool,
 }
 
-#[unstable(feature = "iterator_step_by",
-           reason = "unstable replacement of Range::step_by",
-           issue = "27741")]
+#[stable(feature = "iterator_step_by", since = "1.28.0")]
 impl<I> Iterator for StepBy<I> where I: Iterator {
     type Item = I::Item;
 
@@ -757,9 +753,7 @@ impl<I> Iterator for StepBy<I> where I: Iterator {
 }
 
 // StepBy can only make the iterator shorter, so the len will still fit.
-#[unstable(feature = "iterator_step_by",
-           reason = "unstable replacement of Range::step_by",
-           issue = "27741")]
+#[stable(feature = "iterator_step_by", since = "1.28.0")]
 impl<I> ExactSizeIterator for StepBy<I> where I: ExactSizeIterator {}
 
 /// An iterator that strings two iterators together.
diff --git a/src/libcore/tests/lib.rs b/src/libcore/tests/lib.rs
index 13189d532ab..7c62d0d758d 100644
--- a/src/libcore/tests/lib.rs
+++ b/src/libcore/tests/lib.rs
@@ -23,7 +23,6 @@
 #![feature(flt2dec)]
 #![feature(fmt_internals)]
 #![feature(hashmap_internals)]
-#![feature(iterator_step_by)]
 #![feature(iterator_flatten)]
 #![feature(iterator_repeat_with)]
 #![feature(pattern)]