about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authortinaun <tinagma@gmail.com>2018-04-17 00:30:06 -0400
committertinaun <tinagma@gmail.com>2018-04-17 00:48:23 -0400
commitedc412c5a9ce825d589dcb87dd6028b072139b51 (patch)
tree2b8ebedcc02ace9421ef7b95e3cb64c0f5a1138a /src
parent94516c5038b1203988a3be1d7912d08a6db86202 (diff)
downloadrust-edc412c5a9ce825d589dcb87dd6028b072139b51.tar.gz
rust-edc412c5a9ce825d589dcb87dd6028b072139b51.zip
stabilize `slice_rsplit` feature
Diffstat (limited to 'src')
-rw-r--r--src/doc/unstable-book/src/library-features/slice-rsplit.md10
-rw-r--r--src/liballoc/lib.rs1
-rw-r--r--src/liballoc/slice.rs11
-rw-r--r--src/libcore/slice/mod.rs28
4 files changed, 17 insertions, 33 deletions
diff --git a/src/doc/unstable-book/src/library-features/slice-rsplit.md b/src/doc/unstable-book/src/library-features/slice-rsplit.md
deleted file mode 100644
index 8c2954f7294..00000000000
--- a/src/doc/unstable-book/src/library-features/slice-rsplit.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# `slice_rsplit`
-
-The tracking issue for this feature is: [#41020]
-
-[#41020]: https://github.com/rust-lang/rust/issues/41020
-
-------------------------
-
-The `slice_rsplit` feature enables two methods on slices:
-`slice.rsplit(predicate)` and `slice.rsplit_mut(predicate)`.
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index 3a106a2ff5c..87ad2751c5b 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -108,7 +108,6 @@
 #![feature(ptr_offset_from)]
 #![feature(rustc_attrs)]
 #![feature(slice_get_slice)]
-#![feature(slice_rsplit)]
 #![feature(specialization)]
 #![feature(staged_api)]
 #![feature(str_internals)]
diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs
index 56c53fca62c..eb8a293013d 100644
--- a/src/liballoc/slice.rs
+++ b/src/liballoc/slice.rs
@@ -116,7 +116,7 @@ pub use core::slice::{Iter, IterMut};
 pub use core::slice::{SplitMut, ChunksMut, Split};
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use core::slice::{SplitN, RSplitN, SplitNMut, RSplitNMut};
-#[unstable(feature = "slice_rsplit", issue = "41020")]
+#[stable(feature = "slice_rsplit", since = "1.27.0")]
 pub use core::slice::{RSplit, RSplitMut};
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use core::slice::{from_raw_parts, from_raw_parts_mut};
@@ -888,7 +888,6 @@ impl<T> [T] {
     /// # Examples
     ///
     /// ```
-    /// #![feature(slice_rsplit)]
     ///
     /// let slice = [11, 22, 33, 0, 44, 55];
     /// let mut iter = slice.rsplit(|num| *num == 0);
@@ -902,8 +901,6 @@ impl<T> [T] {
     /// slice will be the first (or last) item returned by the iterator.
     ///
     /// ```
-    /// #![feature(slice_rsplit)]
-    ///
     /// let v = &[0, 1, 1, 2, 3, 5, 8];
     /// let mut it = v.rsplit(|n| *n % 2 == 0);
     /// assert_eq!(it.next().unwrap(), &[]);
@@ -912,7 +909,7 @@ impl<T> [T] {
     /// assert_eq!(it.next().unwrap(), &[]);
     /// assert_eq!(it.next(), None);
     /// ```
-    #[unstable(feature = "slice_rsplit", issue = "41020")]
+    #[stable(feature = "slice_rsplit", since = "1.27.0")]
     #[inline]
     pub fn rsplit<F>(&self, pred: F) -> RSplit<T, F>
         where F: FnMut(&T) -> bool
@@ -927,8 +924,6 @@ impl<T> [T] {
     /// # Examples
     ///
     /// ```
-    /// #![feature(slice_rsplit)]
-    ///
     /// let mut v = [100, 400, 300, 200, 600, 500];
     ///
     /// let mut count = 0;
@@ -939,7 +934,7 @@ impl<T> [T] {
     /// assert_eq!(v, [3, 400, 300, 2, 600, 1]);
     /// ```
     ///
-    #[unstable(feature = "slice_rsplit", issue = "41020")]
+    #[stable(feature = "slice_rsplit", since = "1.27.0")]
     #[inline]
     pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<T, F>
         where F: FnMut(&T) -> bool
diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs
index 0a22028da81..68f081c2e87 100644
--- a/src/libcore/slice/mod.rs
+++ b/src/libcore/slice/mod.rs
@@ -86,7 +86,7 @@ pub trait SliceExt {
     fn split<P>(&self, pred: P) -> Split<Self::Item, P>
         where P: FnMut(&Self::Item) -> bool;
 
-    #[unstable(feature = "slice_rsplit", issue = "41020")]
+    #[stable(feature = "slice_rsplit", since = "1.27.0")]
     fn rsplit<P>(&self, pred: P) -> RSplit<Self::Item, P>
         where P: FnMut(&Self::Item) -> bool;
 
@@ -169,7 +169,7 @@ pub trait SliceExt {
     fn split_mut<P>(&mut self, pred: P) -> SplitMut<Self::Item, P>
         where P: FnMut(&Self::Item) -> bool;
 
-    #[unstable(feature = "slice_rsplit", issue = "41020")]
+    #[stable(feature = "slice_rsplit", since = "1.27.0")]
     fn rsplit_mut<P>(&mut self, pred: P) -> RSplitMut<Self::Item, P>
         where P: FnMut(&Self::Item) -> bool;
 
@@ -1840,13 +1840,13 @@ impl<'a, T, P> FusedIterator for SplitMut<'a, T, P> where P: FnMut(&T) -> bool {
 ///
 /// [`rsplit`]: ../../std/primitive.slice.html#method.rsplit
 /// [slices]: ../../std/primitive.slice.html
-#[unstable(feature = "slice_rsplit", issue = "41020")]
+#[stable(feature = "slice_rsplit", since = "1.27.0")]
 #[derive(Clone)] // Is this correct, or does it incorrectly require `T: Clone`?
 pub struct RSplit<'a, T:'a, P> where P: FnMut(&T) -> bool {
     inner: Split<'a, T, P>
 }
 
-#[unstable(feature = "slice_rsplit", issue = "41020")]
+#[stable(feature = "slice_rsplit", since = "1.27.0")]
 impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for RSplit<'a, T, P> where P: FnMut(&T) -> bool {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         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(&
     }
 }
 
-#[unstable(feature = "slice_rsplit", issue = "41020")]
+#[stable(feature = "slice_rsplit", since = "1.27.0")]
 impl<'a, T, P> Iterator for RSplit<'a, T, P> where P: FnMut(&T) -> bool {
     type Item = &'a [T];
 
@@ -1871,7 +1871,7 @@ impl<'a, T, P> Iterator for RSplit<'a, T, P> where P: FnMut(&T) -> bool {
     }
 }
 
-#[unstable(feature = "slice_rsplit", issue = "41020")]
+#[stable(feature = "slice_rsplit", since = "1.27.0")]
 impl<'a, T, P> DoubleEndedIterator for RSplit<'a, T, P> where P: FnMut(&T) -> bool {
     #[inline]
     fn next_back(&mut self) -> Option<&'a [T]> {
@@ -1879,7 +1879,7 @@ impl<'a, T, P> DoubleEndedIterator for RSplit<'a, T, P> where P: FnMut(&T) -> bo
     }
 }
 
-#[unstable(feature = "slice_rsplit", issue = "41020")]
+#[stable(feature = "slice_rsplit", since = "1.27.0")]
 impl<'a, T, P> SplitIter for RSplit<'a, T, P> where P: FnMut(&T) -> bool {
     #[inline]
     fn finish(&mut self) -> Option<&'a [T]> {
@@ -1887,7 +1887,7 @@ impl<'a, T, P> SplitIter for RSplit<'a, T, P> where P: FnMut(&T) -> bool {
     }
 }
 
-#[unstable(feature = "slice_rsplit", issue = "41020")]
+#[stable(feature = "slice_rsplit", since = "1.27.0")]
 impl<'a, T, P> FusedIterator for RSplit<'a, T, P> where P: FnMut(&T) -> bool {}
 
 /// 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 {}
 ///
 /// [`rsplit_mut`]: ../../std/primitive.slice.html#method.rsplit_mut
 /// [slices]: ../../std/primitive.slice.html
-#[unstable(feature = "slice_rsplit", issue = "41020")]
+#[stable(feature = "slice_rsplit", since = "1.27.0")]
 pub struct RSplitMut<'a, T:'a, P> where P: FnMut(&T) -> bool {
     inner: SplitMut<'a, T, P>
 }
 
-#[unstable(feature = "slice_rsplit", issue = "41020")]
+#[stable(feature = "slice_rsplit", since = "1.27.0")]
 impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         f.debug_struct("RSplitMut")
@@ -1912,7 +1912,7 @@ impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for RSplitMut<'a, T, P> where P: FnMu
     }
 }
 
-#[unstable(feature = "slice_rsplit", issue = "41020")]
+#[stable(feature = "slice_rsplit", since = "1.27.0")]
 impl<'a, T, P> SplitIter for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {
     #[inline]
     fn finish(&mut self) -> Option<&'a mut [T]> {
@@ -1920,7 +1920,7 @@ impl<'a, T, P> SplitIter for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {
     }
 }
 
-#[unstable(feature = "slice_rsplit", issue = "41020")]
+#[stable(feature = "slice_rsplit", since = "1.27.0")]
 impl<'a, T, P> Iterator for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {
     type Item = &'a mut [T];
 
@@ -1935,7 +1935,7 @@ impl<'a, T, P> Iterator for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {
     }
 }
 
-#[unstable(feature = "slice_rsplit", issue = "41020")]
+#[stable(feature = "slice_rsplit", since = "1.27.0")]
 impl<'a, T, P> DoubleEndedIterator for RSplitMut<'a, T, P> where
     P: FnMut(&T) -> bool,
 {
@@ -1945,7 +1945,7 @@ impl<'a, T, P> DoubleEndedIterator for RSplitMut<'a, T, P> where
     }
 }
 
-#[unstable(feature = "slice_rsplit", issue = "41020")]
+#[stable(feature = "slice_rsplit", since = "1.27.0")]
 impl<'a, T, P> FusedIterator for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {}
 
 /// An private iterator over subslices separated by elements that