Skip to content

Commit a2d77f8

Browse files
committed
Stabilize step_by for 1.2.0
step_by is generally useful (it was used in multiple places in the standard library). When it landed in mid-March, it was marked unstable because it was a "recent addition" to the API. It's been two months, and there seems to be no controversy about its inclusion in Rust. Therefore, I propose that we stabilize step_by.
1 parent c654a07 commit a2d77f8

File tree

10 files changed

+6
-14
lines changed

10 files changed

+6
-14
lines changed

src/doc/trpl/iterators.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ has no side effect on the original iterator. Let's try it out with our infinite
285285
iterator from before:
286286

287287
```rust
288-
# #![feature(step_by)]
289288
for i in (1..).step_by(5).take(5) {
290289
println!("{}", i);
291290
}

src/libcollections/bit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
//! [sieve]: http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
3939
//!
4040
//! ```
41-
//! # #![feature(collections, core, step_by)]
41+
//! # #![feature(collections, core)]
4242
//! use std::collections::{BitSet, BitVec};
4343
//! use std::iter;
4444
//!

src/libcollections/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#![feature(unicode)]
3636
#![feature(unique)]
3737
#![feature(unsafe_no_drop_flag, filling_drop)]
38-
#![feature(step_by)]
3938
#![feature(str_char)]
4039
#![feature(str_words)]
4140
#![feature(slice_patterns)]

src/libcollectionstest/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#![feature(unboxed_closures)]
2222
#![feature(unicode)]
2323
#![feature(into_cow)]
24-
#![feature(step_by)]
2524
#![cfg_attr(test, feature(str_char))]
2625
#![cfg_attr(test, feature(vec_deque_retain))]
2726

src/libcore/iter.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2692,7 +2692,7 @@ step_impl_no_between!(u64 i64);
26922692
/// parameter is the type being iterated over, while `R` is the range
26932693
/// type (usually one of `std::ops::{Range, RangeFrom}`.
26942694
#[derive(Clone)]
2695-
#[unstable(feature = "step_by", reason = "recent addition")]
2695+
#[stable(feature = "step_by", since = "1.2.0")]
26962696
pub struct StepBy<A, R> {
26972697
step_by: A,
26982698
range: R,
@@ -2711,7 +2711,7 @@ impl<A: Step> RangeFrom<A> {
27112711
/// ```
27122712
///
27132713
/// This prints all even `u8` values.
2714-
#[unstable(feature = "step_by", reason = "recent addition")]
2714+
#[stable(feature = "step_by", since = "1.2.0")]
27152715
pub fn step_by(self, by: A) -> StepBy<A, Self> {
27162716
StepBy {
27172717
step_by: by,
@@ -2730,7 +2730,7 @@ impl<A: Step> ops::Range<A> {
27302730
/// # Examples
27312731
///
27322732
/// ```
2733-
/// # #![feature(step_by, core)]
2733+
/// # #![feature(core)]
27342734
/// for i in (0..10).step_by(2) {
27352735
/// println!("{}", i);
27362736
/// }
@@ -2745,7 +2745,7 @@ impl<A: Step> ops::Range<A> {
27452745
/// 6
27462746
/// 8
27472747
/// ```
2748-
#[unstable(feature = "step_by", reason = "recent addition")]
2748+
#[stable(feature = "step_by", since = "1.2.0")]
27492749
pub fn step_by(self, by: A) -> StepBy<A, Self> {
27502750
StepBy {
27512751
step_by: by,

src/libcoretest/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#![feature(libc)]
2222
#![feature(hash)]
2323
#![feature(unique)]
24-
#![feature(step_by)]
2524
#![feature(slice_patterns)]
2625
#![feature(float_from_str_radix)]
2726

src/librand/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#![feature(core)]
3232
#![feature(no_std)]
3333
#![feature(staged_api)]
34-
#![feature(step_by)]
3534

3635
#![cfg_attr(test, feature(test, rand, rustc_private))]
3736

src/librustc_back/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#![feature(staged_api)]
4040
#![feature(rand)]
4141
#![feature(path_ext)]
42-
#![feature(step_by)]
4342
#![feature(libc)]
4443
#![feature(fs_canonicalize)]
4544
#![cfg_attr(test, feature(test, rand))]

src/test/bench/shootout-binarytrees.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
3939
// OF THE POSSIBILITY OF SUCH DAMAGE.
4040

41-
#![feature(rustc_private, core, step_by)]
41+
#![feature(rustc_private, core)]
4242

4343
extern crate arena;
4444

src/test/bench/shootout-fannkuch-redux.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
3939
// OF THE POSSIBILITY OF SUCH DAMAGE.
4040

41-
#![feature(step_by)]
42-
4341
use std::{cmp, mem};
4442
use std::thread;
4543

0 commit comments

Comments
 (0)