Skip to content

Commit c4099ca

Browse files
committed
core::iter::repeat_with: general fixes
1 parent 0f789aa commit c4099ca

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/libcore/iter/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ pub use self::range::Step;
333333

334334
#[stable(feature = "rust1", since = "1.0.0")]
335335
pub use self::sources::{Repeat, repeat};
336+
#[unstable(feature = "iterator_repeat_with", issue = "0")]
337+
pub use self::sources::{RepeatWith, repeat_with};
336338
#[stable(feature = "iter_empty", since = "1.2.0")]
337339
pub use self::sources::{Empty, empty};
338340
#[stable(feature = "iter_once", since = "1.2.0")]

src/libcore/iter/sources.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ unsafe impl<A, F: FnMut() -> A> TrustedLen for RepeatWith<F> {}
162162
/// Basic usage:
163163
///
164164
/// ```
165+
/// #![feature("iterator_repeat_with")]
166+
///
165167
/// use std::iter;
166168
///
167169
/// // let's assume we have some value of a type that is not `Clone`
@@ -182,6 +184,8 @@ unsafe impl<A, F: FnMut() -> A> TrustedLen for RepeatWith<F> {}
182184
/// Using mutation and going finite:
183185
///
184186
/// ```rust
187+
/// #![feature("iterator_repeat_with")]
188+
///
185189
/// use std::iter;
186190
///
187191
/// // From the zeroth to the third power of two:

src/libcore/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
#![feature(unwind_attributes)]
9393
#![feature(doc_spotlight)]
9494
#![feature(rustc_const_unstable)]
95+
#![feature(iterator_repeat_with)]
9596

9697
#[prelude_import]
9798
#[allow(unused)]

0 commit comments

Comments
 (0)