///
/// This `struct` is created by [`Iterator::intersperse`]. See its documentation
/// for more information.
-#[stable(feature = "iter_intersperse", since = "1.56.0")]
+#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
#[derive(Debug, Clone)]
pub struct Intersperse<I: Iterator>
where
}
}
-#[stable(feature = "iter_intersperse", since = "1.56.0")]
+#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
impl<I> Iterator for Intersperse<I>
where
I: Iterator,
///
/// This `struct` is created by [`Iterator::intersperse_with`]. See its
/// documentation for more information.
-#[stable(feature = "iter_intersperse", since = "1.56.0")]
+#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
pub struct IntersperseWith<I, G>
where
I: Iterator,
needs_sep: bool,
}
-#[stable(feature = "iter_intersperse", since = "1.56.0")]
+#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
impl<I, G> crate::fmt::Debug for IntersperseWith<I, G>
where
I: Iterator + crate::fmt::Debug,
}
}
-#[stable(feature = "iter_intersperse", since = "1.56.0")]
+#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
impl<I, G> crate::clone::Clone for IntersperseWith<I, G>
where
I: Iterator + crate::clone::Clone,
}
}
-#[stable(feature = "iter_intersperse", since = "1.56.0")]
+#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
impl<I, G> Iterator for IntersperseWith<I, G>
where
I: Iterator,
#[stable(feature = "iter_copied", since = "1.36.0")]
pub use self::copied::Copied;
-#[stable(feature = "iter_intersperse", since = "1.56.0")]
+#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
pub use self::intersperse::{Intersperse, IntersperseWith};
#[stable(feature = "iter_map_while", since = "1.57.0")]
Chain, Cycle, Enumerate, Filter, FilterMap, FlatMap, Fuse, Inspect, Map, Peekable, Rev, Scan,
Skip, SkipWhile, Take, TakeWhile, Zip,
};
-#[stable(feature = "iter_intersperse", since = "1.56.0")]
+#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
pub use self::adapters::{Intersperse, IntersperseWith};
pub(crate) use self::adapters::process_results;
/// Basic usage:
///
/// ```
+ /// #![feature(iter_intersperse)]
+ ///
/// let mut a = [0, 1, 2].iter().intersperse(&100);
/// assert_eq!(a.next(), Some(&0)); // The first element from `a`.
/// assert_eq!(a.next(), Some(&100)); // The separator.
/// ```
///
/// `intersperse` can be very useful to join an iterator's items using a common element:
- ///
/// ```
+ /// #![feature(iter_intersperse)]
+ ///
/// let hello = ["Hello", "World", "!"].iter().copied().intersperse(" ").collect::<String>();
/// assert_eq!(hello, "Hello World !");
/// ```
/// [`Clone`]: crate::clone::Clone
/// [`intersperse_with`]: Iterator::intersperse_with
#[inline]
- #[stable(feature = "iter_intersperse", since = "1.56.0")]
+ #[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
where
Self: Sized,
/// Basic usage:
///
/// ```
+ /// #![feature(iter_intersperse)]
+ ///
/// #[derive(PartialEq, Debug)]
/// struct NotClone(usize);
///
///
/// `intersperse_with` can be used in situations where the separator needs
/// to be computed:
- ///
/// ```
+ /// #![feature(iter_intersperse)]
+ ///
/// let src = ["Hello", "to", "all", "people", "!!"].iter().copied();
///
/// // The closure mutably borrows its context to generate an item.
/// [`Clone`]: crate::clone::Clone
/// [`intersperse`]: Iterator::intersperse
#[inline]
- #[stable(feature = "iter_intersperse", since = "1.56.0")]
+ #[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
where
Self: Sized,
#![feature(int_log)]
#![feature(iter_advance_by)]
#![feature(iter_partition_in_place)]
+#![feature(iter_intersperse)]
#![feature(iter_is_partitioned)]
#![feature(iter_order_by)]
#![feature(const_mut_refs)]
#![feature(never_type)]
#![feature(once_cell)]
#![feature(type_ascription)]
+#![feature(iter_intersperse)]
#![recursion_limit = "256"]
#![warn(rustc::internal)]