diff --git a/src/libcore/iter/mod.rs b/src/libcore/iter/mod.rs index 29b62c901f31..ac3fb5a57dd3 100644 --- a/src/libcore/iter/mod.rs +++ b/src/libcore/iter/mod.rs @@ -333,6 +333,8 @@ pub use self::range::Step; #[stable(feature = "rust1", since = "1.0.0")] pub use self::sources::{Repeat, repeat}; +#[unstable(feature = "iterator_repeat_with", issue = "0")] +pub use self::sources::{RepeatWith, repeat_with}; #[stable(feature = "iter_empty", since = "1.2.0")] pub use self::sources::{Empty, empty}; #[stable(feature = "iter_once", since = "1.2.0")] diff --git a/src/libcore/iter/sources.rs b/src/libcore/iter/sources.rs index 980f3fc7443a..2cf90fd079e2 100644 --- a/src/libcore/iter/sources.rs +++ b/src/libcore/iter/sources.rs @@ -162,6 +162,8 @@ unsafe impl A> TrustedLen for RepeatWith {} /// Basic usage: /// /// ``` +/// #![feature("iterator_repeat_with")] +/// /// use std::iter; /// /// // let's assume we have some value of a type that is not `Clone` @@ -182,6 +184,8 @@ unsafe impl A> TrustedLen for RepeatWith {} /// Using mutation and going finite: /// /// ```rust +/// #![feature("iterator_repeat_with")] +/// /// use std::iter; /// /// // From the zeroth to the third power of two: diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 59a296c2a762..447e144bf0fd 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -92,6 +92,7 @@ #![feature(unwind_attributes)] #![feature(doc_spotlight)] #![feature(rustc_const_unstable)] +#![feature(iterator_repeat_with)] #[prelude_import] #[allow(unused)]