Skip to content

Commit 874124b

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 7a9cdc4 commit 874124b

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
@@ -1950,7 +1950,7 @@ impl<T> Vec<T> {
19501950
/// assert_eq!(u, &[1, 2]);
19511951
/// ```
19521952
#[inline]
1953-
#[stable(feature = "vec_splice", since = "1.22.0")]
1953+
#[stable(feature = "vec_splice", since = "1.21.0")]
19541954
pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<I::IntoIter>
19551955
where R: RangeArgument<usize>, I: IntoIterator<Item=T>
19561956
{
@@ -2553,13 +2553,13 @@ impl<'a, T> InPlace<T> for PlaceBack<'a, T> {
25532553
/// [`splice()`]: struct.Vec.html#method.splice
25542554
/// [`Vec`]: struct.Vec.html
25552555
#[derive(Debug)]
2556-
#[stable(feature = "vec_splice", since = "1.22.0")]
2556+
#[stable(feature = "vec_splice", since = "1.21.0")]
25572557
pub struct Splice<'a, I: Iterator + 'a> {
25582558
drain: Drain<'a, I::Item>,
25592559
replace_with: I,
25602560
}
25612561

2562-
#[stable(feature = "vec_splice", since = "1.22.0")]
2562+
#[stable(feature = "vec_splice", since = "1.21.0")]
25632563
impl<'a, I: Iterator> Iterator for Splice<'a, I> {
25642564
type Item = I::Item;
25652565

@@ -2572,18 +2572,18 @@ impl<'a, I: Iterator> Iterator for Splice<'a, I> {
25722572
}
25732573
}
25742574

2575-
#[stable(feature = "vec_splice", since = "1.22.0")]
2575+
#[stable(feature = "vec_splice", since = "1.21.0")]
25762576
impl<'a, I: Iterator> DoubleEndedIterator for Splice<'a, I> {
25772577
fn next_back(&mut self) -> Option<Self::Item> {
25782578
self.drain.next_back()
25792579
}
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> ExactSizeIterator for Splice<'a, I> {}
25842584

25852585

2586-
#[stable(feature = "vec_splice", since = "1.22.0")]
2586+
#[stable(feature = "vec_splice", since = "1.21.0")]
25872587
impl<'a, I: Iterator> Drop for Splice<'a, I> {
25882588
fn drop(&mut self) {
25892589
// 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
@@ -402,7 +402,7 @@ pub fn align_of_val<T: ?Sized>(val: &T) -> usize {
402402
/// }
403403
/// ```
404404
#[inline]
405-
#[stable(feature = "needs_drop", since = "1.22.0")]
405+
#[stable(feature = "needs_drop", since = "1.21.0")]
406406
pub fn needs_drop<T>() -> bool {
407407
unsafe { intrinsics::needs_drop::<T>() }
408408
}

src/libcore/sync/atomic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1752,7 +1752,7 @@ pub fn fence(order: Ordering) {
17521752
/// [`Relaxed`]: enum.Ordering.html#variant.Relaxed
17531753
/// [memory barriers]: https://www.kernel.org/doc/Documentation/memory-barriers.txt
17541754
#[inline]
1755-
#[stable(feature = "compiler_fences", since = "1.22.0")]
1755+
#[stable(feature = "compiler_fences", since = "1.21.0")]
17561756
pub fn compiler_fence(order: Ordering) {
17571757
unsafe {
17581758
match order {

src/libstd/net/tcp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl TcpStream {
167167
/// connection request.
168168
///
169169
/// [`SocketAddr`]: ../../std/net/enum.SocketAddr.html
170-
#[stable(feature = "tcpstream_connect_timeout", since = "1.22.0")]
170+
#[stable(feature = "tcpstream_connect_timeout", since = "1.21.0")]
171171
pub fn connect_timeout(addr: &SocketAddr, timeout: Duration) -> io::Result<TcpStream> {
172172
net_imp::TcpStream::connect_timeout(addr, timeout).map(TcpStream)
173173
}

0 commit comments

Comments
 (0)