diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 9d7585993c33..053a85a7c51a 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -2542,6 +2542,9 @@ impl RandomAccessIterator for Inspect /// ``` #[unstable(feature = "iter_unfold")] #[derive(Clone)] +#[deprecated(since = "1.2.0", + reason = "has gained enough traction to retain its position \ + in the standard library")] pub struct Unfold { f: F, /// Internal state that will be passed to the closure on the next iteration @@ -2550,6 +2553,9 @@ pub struct Unfold { } #[unstable(feature = "iter_unfold")] +#[deprecated(since = "1.2.0", + reason = "has gained enough traction to retain its position \ + in the standard library")] impl Unfold where F: FnMut(&mut St) -> Option { /// Creates a new iterator with the specified closure as the "iterator /// function" and an initial state to eventually pass to the closure @@ -2995,11 +3001,17 @@ type IterateState = (F, Option, bool); /// An iterator that repeatedly applies a given function, starting /// from a given seed value. #[unstable(feature = "iter_iterate")] +#[deprecated(since = "1.2.0", + reason = "has gained enough traction to retain its position \ + in the standard library")] pub type Iterate = Unfold, fn(&mut IterateState) -> Option>; /// Creates a new iterator that produces an infinite sequence of /// repeated applications of the given function `f`. #[unstable(feature = "iter_iterate")] +#[deprecated(since = "1.2.0", + reason = "has gained enough traction to retain its position \ + in the standard library")] pub fn iterate(seed: T, f: F) -> Iterate where T: Clone, F: FnMut(T) -> T,