about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2018-02-12 08:25:39 +0100
committerMazdak Farrokhzad <twingoow@gmail.com>2018-02-12 08:25:39 +0100
commitc4099ca4b11acb9949ef0da804a819b4ddfa24a2 (patch)
tree9700a7b9e1f2511cea9f15157d3e1c22246bc988 /src/libcore
parent0f789aad2b3cfc0b0925b726295200267130e69d (diff)
downloadrust-c4099ca4b11acb9949ef0da804a819b4ddfa24a2.tar.gz
rust-c4099ca4b11acb9949ef0da804a819b4ddfa24a2.zip
core::iter::repeat_with: general fixes
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/iter/mod.rs2
-rw-r--r--src/libcore/iter/sources.rs4
-rw-r--r--src/libcore/lib.rs1
3 files changed, 7 insertions, 0 deletions
diff --git a/src/libcore/iter/mod.rs b/src/libcore/iter/mod.rs
index 29b62c901f3..ac3fb5a57dd 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 980f3fc7443..2cf90fd079e 100644
--- a/src/libcore/iter/sources.rs
+++ b/src/libcore/iter/sources.rs
@@ -162,6 +162,8 @@ unsafe impl<A, F: FnMut() -> A> TrustedLen for RepeatWith<F> {}
 /// 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, F: FnMut() -> A> TrustedLen for RepeatWith<F> {}
 /// 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 59a296c2a76..447e144bf0f 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)]