This includes the following stabilizations:
- tcpstream_connect_timeout https://github.com/rust-lang/rust/pull/44563
- iterator_for_each https://github.com/rust-lang/rust/pull/44567
- ord_max_min https://github.com/rust-lang/rust/pull/44593
- compiler_fences https://github.com/rust-lang/rust/pull/44595
- needs_drop https://github.com/rust-lang/rust/pull/44639
- vec_splice https://github.com/rust-lang/rust/pull/44640
/// assert_eq!(u, &[1, 2]);
/// ```
#[inline]
/// assert_eq!(u, &[1, 2]);
/// ```
#[inline]
- #[stable(feature = "vec_splice", since = "1.22.0")]
+ #[stable(feature = "vec_splice", since = "1.21.0")]
pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<I::IntoIter>
where R: RangeArgument<usize>, I: IntoIterator<Item=T>
{
pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<I::IntoIter>
where R: RangeArgument<usize>, I: IntoIterator<Item=T>
{
/// [`splice()`]: struct.Vec.html#method.splice
/// [`Vec`]: struct.Vec.html
#[derive(Debug)]
/// [`splice()`]: struct.Vec.html#method.splice
/// [`Vec`]: struct.Vec.html
#[derive(Debug)]
-#[stable(feature = "vec_splice", since = "1.22.0")]
+#[stable(feature = "vec_splice", since = "1.21.0")]
pub struct Splice<'a, I: Iterator + 'a> {
drain: Drain<'a, I::Item>,
replace_with: I,
}
pub struct Splice<'a, I: Iterator + 'a> {
drain: Drain<'a, I::Item>,
replace_with: I,
}
-#[stable(feature = "vec_splice", since = "1.22.0")]
+#[stable(feature = "vec_splice", since = "1.21.0")]
impl<'a, I: Iterator> Iterator for Splice<'a, I> {
type Item = I::Item;
impl<'a, I: Iterator> Iterator for Splice<'a, I> {
type Item = I::Item;
-#[stable(feature = "vec_splice", since = "1.22.0")]
+#[stable(feature = "vec_splice", since = "1.21.0")]
impl<'a, I: Iterator> DoubleEndedIterator for Splice<'a, I> {
fn next_back(&mut self) -> Option<Self::Item> {
self.drain.next_back()
}
}
impl<'a, I: Iterator> DoubleEndedIterator for Splice<'a, I> {
fn next_back(&mut self) -> Option<Self::Item> {
self.drain.next_back()
}
}
-#[stable(feature = "vec_splice", since = "1.22.0")]
+#[stable(feature = "vec_splice", since = "1.21.0")]
impl<'a, I: Iterator> ExactSizeIterator for Splice<'a, I> {}
impl<'a, I: Iterator> ExactSizeIterator for Splice<'a, I> {}
-#[stable(feature = "vec_splice", since = "1.22.0")]
+#[stable(feature = "vec_splice", since = "1.21.0")]
impl<'a, I: Iterator> Drop for Splice<'a, I> {
fn drop(&mut self) {
// exhaust drain first
impl<'a, I: Iterator> Drop for Splice<'a, I> {
fn drop(&mut self) {
// exhaust drain first
/// assert_eq!(2, 1.max(2));
/// assert_eq!(2, 2.max(2));
/// ```
/// assert_eq!(2, 1.max(2));
/// assert_eq!(2, 2.max(2));
/// ```
- #[stable(feature = "ord_max_min", since = "1.22.0")]
+ #[stable(feature = "ord_max_min", since = "1.21.0")]
fn max(self, other: Self) -> Self
where Self: Sized {
if other >= self { other } else { self }
fn max(self, other: Self) -> Self
where Self: Sized {
if other >= self { other } else { self }
/// assert_eq!(1, 1.min(2));
/// assert_eq!(2, 2.min(2));
/// ```
/// assert_eq!(1, 1.min(2));
/// assert_eq!(2, 2.min(2));
/// ```
- #[stable(feature = "ord_max_min", since = "1.22.0")]
+ #[stable(feature = "ord_max_min", since = "1.21.0")]
fn min(self, other: Self) -> Self
where Self: Sized {
if self <= other { self } else { other }
fn min(self, other: Self) -> Self
where Self: Sized {
if self <= other { self } else { other }
/// .for_each(|(i, x)| println!("{}:{}", i, x));
/// ```
#[inline]
/// .for_each(|(i, x)| println!("{}:{}", i, x));
/// ```
#[inline]
- #[stable(feature = "iterator_for_each", since = "1.22.0")]
+ #[stable(feature = "iterator_for_each", since = "1.21.0")]
fn for_each<F>(self, mut f: F) where
Self: Sized, F: FnMut(Self::Item),
{
fn for_each<F>(self, mut f: F) where
Self: Sized, F: FnMut(Self::Item),
{
-#[stable(feature = "needs_drop", since = "1.22.0")]
+#[stable(feature = "needs_drop", since = "1.21.0")]
pub fn needs_drop<T>() -> bool {
unsafe { intrinsics::needs_drop::<T>() }
}
pub fn needs_drop<T>() -> bool {
unsafe { intrinsics::needs_drop::<T>() }
}
/// [`Relaxed`]: enum.Ordering.html#variant.Relaxed
/// [memory barriers]: https://www.kernel.org/doc/Documentation/memory-barriers.txt
#[inline]
/// [`Relaxed`]: enum.Ordering.html#variant.Relaxed
/// [memory barriers]: https://www.kernel.org/doc/Documentation/memory-barriers.txt
#[inline]
-#[stable(feature = "compiler_fences", since = "1.22.0")]
+#[stable(feature = "compiler_fences", since = "1.21.0")]
pub fn compiler_fence(order: Ordering) {
unsafe {
match order {
pub fn compiler_fence(order: Ordering) {
unsafe {
match order {
/// connection request.
///
/// [`SocketAddr`]: ../../std/net/enum.SocketAddr.html
/// connection request.
///
/// [`SocketAddr`]: ../../std/net/enum.SocketAddr.html
- #[stable(feature = "tcpstream_connect_timeout", since = "1.22.0")]
+ #[stable(feature = "tcpstream_connect_timeout", since = "1.21.0")]
pub fn connect_timeout(addr: &SocketAddr, timeout: Duration) -> io::Result<TcpStream> {
net_imp::TcpStream::connect_timeout(addr, timeout).map(TcpStream)
}
pub fn connect_timeout(addr: &SocketAddr, timeout: Duration) -> io::Result<TcpStream> {
net_imp::TcpStream::connect_timeout(addr, timeout).map(TcpStream)
}