Skip to content

Commit edc412c

Browse files
committed
stabilize slice_rsplit feature
1 parent 94516c5 commit edc412c

File tree

4 files changed

+17
-33
lines changed

4 files changed

+17
-33
lines changed

src/doc/unstable-book/src/library-features/slice-rsplit.md

-10
This file was deleted.

src/liballoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@
108108
#![feature(ptr_offset_from)]
109109
#![feature(rustc_attrs)]
110110
#![feature(slice_get_slice)]
111-
#![feature(slice_rsplit)]
112111
#![feature(specialization)]
113112
#![feature(staged_api)]
114113
#![feature(str_internals)]

src/liballoc/slice.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub use core::slice::{Iter, IterMut};
116116
pub use core::slice::{SplitMut, ChunksMut, Split};
117117
#[stable(feature = "rust1", since = "1.0.0")]
118118
pub use core::slice::{SplitN, RSplitN, SplitNMut, RSplitNMut};
119-
#[unstable(feature = "slice_rsplit", issue = "41020")]
119+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
120120
pub use core::slice::{RSplit, RSplitMut};
121121
#[stable(feature = "rust1", since = "1.0.0")]
122122
pub use core::slice::{from_raw_parts, from_raw_parts_mut};
@@ -888,7 +888,6 @@ impl<T> [T] {
888888
/// # Examples
889889
///
890890
/// ```
891-
/// #![feature(slice_rsplit)]
892891
///
893892
/// let slice = [11, 22, 33, 0, 44, 55];
894893
/// let mut iter = slice.rsplit(|num| *num == 0);
@@ -902,8 +901,6 @@ impl<T> [T] {
902901
/// slice will be the first (or last) item returned by the iterator.
903902
///
904903
/// ```
905-
/// #![feature(slice_rsplit)]
906-
///
907904
/// let v = &[0, 1, 1, 2, 3, 5, 8];
908905
/// let mut it = v.rsplit(|n| *n % 2 == 0);
909906
/// assert_eq!(it.next().unwrap(), &[]);
@@ -912,7 +909,7 @@ impl<T> [T] {
912909
/// assert_eq!(it.next().unwrap(), &[]);
913910
/// assert_eq!(it.next(), None);
914911
/// ```
915-
#[unstable(feature = "slice_rsplit", issue = "41020")]
912+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
916913
#[inline]
917914
pub fn rsplit<F>(&self, pred: F) -> RSplit<T, F>
918915
where F: FnMut(&T) -> bool
@@ -927,8 +924,6 @@ impl<T> [T] {
927924
/// # Examples
928925
///
929926
/// ```
930-
/// #![feature(slice_rsplit)]
931-
///
932927
/// let mut v = [100, 400, 300, 200, 600, 500];
933928
///
934929
/// let mut count = 0;
@@ -939,7 +934,7 @@ impl<T> [T] {
939934
/// assert_eq!(v, [3, 400, 300, 2, 600, 1]);
940935
/// ```
941936
///
942-
#[unstable(feature = "slice_rsplit", issue = "41020")]
937+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
943938
#[inline]
944939
pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<T, F>
945940
where F: FnMut(&T) -> bool

src/libcore/slice/mod.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub trait SliceExt {
8686
fn split<P>(&self, pred: P) -> Split<Self::Item, P>
8787
where P: FnMut(&Self::Item) -> bool;
8888

89-
#[unstable(feature = "slice_rsplit", issue = "41020")]
89+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
9090
fn rsplit<P>(&self, pred: P) -> RSplit<Self::Item, P>
9191
where P: FnMut(&Self::Item) -> bool;
9292

@@ -169,7 +169,7 @@ pub trait SliceExt {
169169
fn split_mut<P>(&mut self, pred: P) -> SplitMut<Self::Item, P>
170170
where P: FnMut(&Self::Item) -> bool;
171171

172-
#[unstable(feature = "slice_rsplit", issue = "41020")]
172+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
173173
fn rsplit_mut<P>(&mut self, pred: P) -> RSplitMut<Self::Item, P>
174174
where P: FnMut(&Self::Item) -> bool;
175175

@@ -1840,13 +1840,13 @@ impl<'a, T, P> FusedIterator for SplitMut<'a, T, P> where P: FnMut(&T) -> bool {
18401840
///
18411841
/// [`rsplit`]: ../../std/primitive.slice.html#method.rsplit
18421842
/// [slices]: ../../std/primitive.slice.html
1843-
#[unstable(feature = "slice_rsplit", issue = "41020")]
1843+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
18441844
#[derive(Clone)] // Is this correct, or does it incorrectly require `T: Clone`?
18451845
pub struct RSplit<'a, T:'a, P> where P: FnMut(&T) -> bool {
18461846
inner: Split<'a, T, P>
18471847
}
18481848

1849-
#[unstable(feature = "slice_rsplit", issue = "41020")]
1849+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
18501850
impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for RSplit<'a, T, P> where P: FnMut(&T) -> bool {
18511851
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
18521852
f.debug_struct("RSplit")
@@ -1856,7 +1856,7 @@ impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for RSplit<'a, T, P> where P: FnMut(&
18561856
}
18571857
}
18581858

1859-
#[unstable(feature = "slice_rsplit", issue = "41020")]
1859+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
18601860
impl<'a, T, P> Iterator for RSplit<'a, T, P> where P: FnMut(&T) -> bool {
18611861
type Item = &'a [T];
18621862

@@ -1871,23 +1871,23 @@ impl<'a, T, P> Iterator for RSplit<'a, T, P> where P: FnMut(&T) -> bool {
18711871
}
18721872
}
18731873

1874-
#[unstable(feature = "slice_rsplit", issue = "41020")]
1874+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
18751875
impl<'a, T, P> DoubleEndedIterator for RSplit<'a, T, P> where P: FnMut(&T) -> bool {
18761876
#[inline]
18771877
fn next_back(&mut self) -> Option<&'a [T]> {
18781878
self.inner.next()
18791879
}
18801880
}
18811881

1882-
#[unstable(feature = "slice_rsplit", issue = "41020")]
1882+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
18831883
impl<'a, T, P> SplitIter for RSplit<'a, T, P> where P: FnMut(&T) -> bool {
18841884
#[inline]
18851885
fn finish(&mut self) -> Option<&'a [T]> {
18861886
self.inner.finish()
18871887
}
18881888
}
18891889

1890-
#[unstable(feature = "slice_rsplit", issue = "41020")]
1890+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
18911891
impl<'a, T, P> FusedIterator for RSplit<'a, T, P> where P: FnMut(&T) -> bool {}
18921892

18931893
/// An iterator over the subslices of the vector which are separated
@@ -1897,12 +1897,12 @@ impl<'a, T, P> FusedIterator for RSplit<'a, T, P> where P: FnMut(&T) -> bool {}
18971897
///
18981898
/// [`rsplit_mut`]: ../../std/primitive.slice.html#method.rsplit_mut
18991899
/// [slices]: ../../std/primitive.slice.html
1900-
#[unstable(feature = "slice_rsplit", issue = "41020")]
1900+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
19011901
pub struct RSplitMut<'a, T:'a, P> where P: FnMut(&T) -> bool {
19021902
inner: SplitMut<'a, T, P>
19031903
}
19041904

1905-
#[unstable(feature = "slice_rsplit", issue = "41020")]
1905+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
19061906
impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {
19071907
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
19081908
f.debug_struct("RSplitMut")
@@ -1912,15 +1912,15 @@ impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for RSplitMut<'a, T, P> where P: FnMu
19121912
}
19131913
}
19141914

1915-
#[unstable(feature = "slice_rsplit", issue = "41020")]
1915+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
19161916
impl<'a, T, P> SplitIter for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {
19171917
#[inline]
19181918
fn finish(&mut self) -> Option<&'a mut [T]> {
19191919
self.inner.finish()
19201920
}
19211921
}
19221922

1923-
#[unstable(feature = "slice_rsplit", issue = "41020")]
1923+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
19241924
impl<'a, T, P> Iterator for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {
19251925
type Item = &'a mut [T];
19261926

@@ -1935,7 +1935,7 @@ impl<'a, T, P> Iterator for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {
19351935
}
19361936
}
19371937

1938-
#[unstable(feature = "slice_rsplit", issue = "41020")]
1938+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
19391939
impl<'a, T, P> DoubleEndedIterator for RSplitMut<'a, T, P> where
19401940
P: FnMut(&T) -> bool,
19411941
{
@@ -1945,7 +1945,7 @@ impl<'a, T, P> DoubleEndedIterator for RSplitMut<'a, T, P> where
19451945
}
19461946
}
19471947

1948-
#[unstable(feature = "slice_rsplit", issue = "41020")]
1948+
#[stable(feature = "slice_rsplit", since = "1.27.0")]
19491949
impl<'a, T, P> FusedIterator for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {}
19501950

19511951
/// An private iterator over subslices separated by elements that

0 commit comments

Comments
 (0)