core::iter::repeat_with: general fixes

This commit is contained in:
Mazdak Farrokhzad 2018-02-12 08:25:39 +01:00
parent 0f789aad2b
commit c4099ca4b1
3 changed files with 7 additions and 0 deletions

View file

@ -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")]

View file

@ -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:

View file

@ -92,6 +92,7 @@
#![feature(unwind_attributes)]
#![feature(doc_spotlight)]
#![feature(rustc_const_unstable)]
#![feature(iterator_repeat_with)]
#[prelude_import]
#[allow(unused)]