about summary refs log tree commit diff
path: root/src
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
parent4ecf12bf0eb8386626ccdb5f721a7183ccc4eba6 (diff)
downloadrust-72e17b81fa88894e3fe04f221166f5a48e753e94.tar.gz
rust-72e17b81fa88894e3fe04f221166f5a48e753e94.zip
Stabilize Iterator::step_by
Fixes #27741
Diffstat (limited to 'src')
-rw-r--r--src/liballoc/tests/lib.rs1
-rw-r--r--src/libcore/iter/iterator.rs5
-rw-r--r--src/libcore/iter/mod.rs12
-rw-r--r--src/libcore/tests/lib.rs1
-rw-r--r--src/test/run-pass/range_inclusive.rs2
-rw-r--r--src/test/run-pass/sync-send-iterators-in-libcore.rs1
6 files changed, 4 insertions, 18 deletions
diff --git a/src/liballoc/tests/lib.rs b/src/liballoc/tests/lib.rs
index 081c473768f..dbac2c0bb18 100644
--- a/src/liballoc/tests/lib.rs
+++ b/src/liballoc/tests/lib.rs
@@ -15,7 +15,6 @@
 #![feature(const_fn)]
 #![feature(drain_filter)]
 #![feature(exact_size_is_empty)]
-#![feature(iterator_step_by)]
 #![feature(pattern)]
 #![feature(rand)]
 #![feature(slice_sort_by_cached_key)]
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)]
diff --git a/src/test/run-pass/range_inclusive.rs b/src/test/run-pass/range_inclusive.rs
index 5d46bfab887..b08d16e5088 100644
--- a/src/test/run-pass/range_inclusive.rs
+++ b/src/test/run-pass/range_inclusive.rs
@@ -10,8 +10,6 @@
 
 // Test inclusive range syntax.
 
-#![feature(iterator_step_by)]
-
 use std::ops::{RangeInclusive, RangeToInclusive};
 
 fn foo() -> isize { 42 }
diff --git a/src/test/run-pass/sync-send-iterators-in-libcore.rs b/src/test/run-pass/sync-send-iterators-in-libcore.rs
index c11a0d391a4..bb190543ecd 100644
--- a/src/test/run-pass/sync-send-iterators-in-libcore.rs
+++ b/src/test/run-pass/sync-send-iterators-in-libcore.rs
@@ -14,7 +14,6 @@
 #![feature(iter_empty)]
 #![feature(iter_once)]
 #![feature(iter_unfold)]
-#![feature(iterator_step_by)]
 #![feature(str_escape)]
 
 use std::iter::{empty, once, repeat};