Skip to content

Commit a8117df

Browse files
committed
Backport libs stabilizations to 1.21 beta
This includes the following stabilizations: - tcpstream_connect_timeout #44563 - iterator_for_each #44567 - ord_max_min #44593 - compiler_fences #44595 - needs_drop #44639 - vec_splice #44640
1 parent 6185701 commit a8117df

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

src/liballoc/vec.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,7 @@ impl<T> Vec<T> {
19491949
/// assert_eq!(u, &[1, 2]);
19501950
/// ```
19511951
#[inline]
1952-
#[stable(feature = "vec_splice", since = "1.22.0")]
1952+
#[stable(feature = "vec_splice", since = "1.21.0")]
19531953
pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<I::IntoIter>
19541954
where R: RangeArgument<usize>, I: IntoIterator<Item=T>
19551955
{
@@ -2549,13 +2549,13 @@ impl<'a, T> InPlace<T> for PlaceBack<'a, T> {
25492549
/// [`splice()`]: struct.Vec.html#method.splice
25502550
/// [`Vec`]: struct.Vec.html
25512551
#[derive(Debug)]
2552-
#[stable(feature = "vec_splice", since = "1.22.0")]
2552+
#[stable(feature = "vec_splice", since = "1.21.0")]
25532553
pub struct Splice<'a, I: Iterator + 'a> {
25542554
drain: Drain<'a, I::Item>,
25552555
replace_with: I,
25562556
}
25572557

2558-
#[stable(feature = "vec_splice", since = "1.22.0")]
2558+
#[stable(feature = "vec_splice", since = "1.21.0")]
25592559
impl<'a, I: Iterator> Iterator for Splice<'a, I> {
25602560
type Item = I::Item;
25612561

@@ -2568,18 +2568,18 @@ impl<'a, I: Iterator> Iterator for Splice<'a, I> {
25682568
}
25692569
}
25702570

2571-
#[stable(feature = "vec_splice", since = "1.22.0")]
2571+
#[stable(feature = "vec_splice", since = "1.21.0")]
25722572
impl<'a, I: Iterator> DoubleEndedIterator for Splice<'a, I> {
25732573
fn next_back(&mut self) -> Option<Self::Item> {
25742574
self.drain.next_back()
25752575
}
25762576
}
25772577

2578-
#[stable(feature = "vec_splice", since = "1.22.0")]
2578+
#[stable(feature = "vec_splice", since = "1.21.0")]
25792579
impl<'a, I: Iterator> ExactSizeIterator for Splice<'a, I> {}
25802580

25812581

2582-
#[stable(feature = "vec_splice", since = "1.22.0")]
2582+
#[stable(feature = "vec_splice", since = "1.21.0")]
25832583
impl<'a, I: Iterator> Drop for Splice<'a, I> {
25842584
fn drop(&mut self) {
25852585
// exhaust drain first

src/libcore/cmp.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
456456
/// assert_eq!(2, 1.max(2));
457457
/// assert_eq!(2, 2.max(2));
458458
/// ```
459-
#[stable(feature = "ord_max_min", since = "1.22.0")]
459+
#[stable(feature = "ord_max_min", since = "1.21.0")]
460460
fn max(self, other: Self) -> Self
461461
where Self: Sized {
462462
if other >= self { other } else { self }
@@ -472,7 +472,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
472472
/// assert_eq!(1, 1.min(2));
473473
/// assert_eq!(2, 2.min(2));
474474
/// ```
475-
#[stable(feature = "ord_max_min", since = "1.22.0")]
475+
#[stable(feature = "ord_max_min", since = "1.21.0")]
476476
fn min(self, other: Self) -> Self
477477
where Self: Sized {
478478
if self <= other { self } else { other }

src/libcore/iter/iterator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ pub trait Iterator {
518518
/// .for_each(|(i, x)| println!("{}:{}", i, x));
519519
/// ```
520520
#[inline]
521-
#[stable(feature = "iterator_for_each", since = "1.22.0")]
521+
#[stable(feature = "iterator_for_each", since = "1.21.0")]
522522
fn for_each<F>(self, mut f: F) where
523523
Self: Sized, F: FnMut(Self::Item),
524524
{

src/libcore/mem.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ pub fn align_of_val<T: ?Sized>(val: &T) -> usize {
398398
/// }
399399
/// ```
400400
#[inline]
401-
#[stable(feature = "needs_drop", since = "1.22.0")]
401+
#[stable(feature = "needs_drop", since = "1.21.0")]
402402
pub fn needs_drop<T>() -> bool {
403403
unsafe { intrinsics::needs_drop::<T>() }
404404
}

src/libcore/sync/atomic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1739,7 +1739,7 @@ pub fn fence(order: Ordering) {
17391739
/// [`Relaxed`]: enum.Ordering.html#variant.Relaxed
17401740
/// [memory barriers]: https://www.kernel.org/doc/Documentation/memory-barriers.txt
17411741
#[inline]
1742-
#[stable(feature = "compiler_fences", since = "1.22.0")]
1742+
#[stable(feature = "compiler_fences", since = "1.21.0")]
17431743
pub fn compiler_fence(order: Ordering) {
17441744
unsafe {
17451745
match order {

src/libstd/net/tcp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl TcpStream {
147147
/// connection request.
148148
///
149149
/// [`SocketAddr`]: ../../std/net/enum.SocketAddr.html
150-
#[stable(feature = "tcpstream_connect_timeout", since = "1.22.0")]
150+
#[stable(feature = "tcpstream_connect_timeout", since = "1.21.0")]
151151
pub fn connect_timeout(addr: &SocketAddr, timeout: Duration) -> io::Result<TcpStream> {
152152
net_imp::TcpStream::connect_timeout(addr, timeout).map(TcpStream)
153153
}

0 commit comments

Comments
 (0)