]> git.lizzy.rs Git - rust.git/commitdiff
std: Stabilize `str_checked_slicing` feature
authorAlex Crichton <alex@alexcrichton.com>
Thu, 20 Jul 2017 22:42:14 +0000 (15:42 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 25 Jul 2017 14:09:31 +0000 (07:09 -0700)
Stabilized

* `<str>::get`
* `<str>::get_mut`
* `<str>::get_unchecked`
* `<str>::get_unchecked_mut`

Closes #39932

src/liballoc/lib.rs
src/liballoc/str.rs
src/liballoc/tests/lib.rs
src/libcore/str/mod.rs

index 7e6ee4bd49d92e4da0ae4e0f812d5ecf96a112b0..2b28538c47d5ae42b8b62c8f97774d1d2cedc8b7 100644 (file)
@@ -82,7 +82,6 @@
 #![cfg_attr(not(test), feature(core_float))]
 #![cfg_attr(not(test), feature(exact_size_is_empty))]
 #![cfg_attr(not(test), feature(slice_rotate))]
-#![cfg_attr(not(test), feature(str_checked_slicing))]
 #![cfg_attr(test, feature(rand, test))]
 #![cfg_attr(stage0, feature(allocator))]
 #![feature(allow_internal_unstable)]
index f56288c30132c13e52196507acfcf17247c40aa7..e4953988c5c12eedcf2af54a4669ebfedd52452e 100644 (file)
@@ -328,14 +328,13 @@ pub fn as_ptr(&self) -> *const u8 {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(str_checked_slicing)]
     /// let v = "🗻∈🌏";
     /// assert_eq!(Some("🗻"), v.get(0..4));
     /// assert!(v.get(1..).is_none());
     /// assert!(v.get(..8).is_none());
     /// assert!(v.get(..42).is_none());
     /// ```
-    #[unstable(feature = "str_checked_slicing", issue = "39932")]
+    #[stable(feature = "str_checked_slicing", since = "1.20.0")]
     #[inline]
     pub fn get<I: SliceIndex<str>>(&self, i: I) -> Option<&I::Output> {
         core_str::StrExt::get(self, i)
@@ -351,14 +350,13 @@ pub fn get<I: SliceIndex<str>>(&self, i: I) -> Option<&I::Output> {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(str_checked_slicing)]
     /// let mut v = String::from("🗻∈🌏");
     /// assert_eq!(Some("🗻"), v.get_mut(0..4).map(|v| &*v));
     /// assert!(v.get_mut(1..).is_none());
     /// assert!(v.get_mut(..8).is_none());
     /// assert!(v.get_mut(..42).is_none());
     /// ```
-    #[unstable(feature = "str_checked_slicing", issue = "39932")]
+    #[stable(feature = "str_checked_slicing", since = "1.20.0")]
     #[inline]
     pub fn get_mut<I: SliceIndex<str>>(&mut self, i: I) -> Option<&mut I::Output> {
         core_str::StrExt::get_mut(self, i)
@@ -383,7 +381,6 @@ pub fn get_mut<I: SliceIndex<str>>(&mut self, i: I) -> Option<&mut I::Output> {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(str_checked_slicing)]
     /// let v = "🗻∈🌏";
     /// unsafe {
     ///     assert_eq!("🗻", v.get_unchecked(0..4));
@@ -391,7 +388,7 @@ pub fn get_mut<I: SliceIndex<str>>(&mut self, i: I) -> Option<&mut I::Output> {
     ///     assert_eq!("🌏", v.get_unchecked(7..11));
     /// }
     /// ```
-    #[unstable(feature = "str_checked_slicing", issue = "39932")]
+    #[stable(feature = "str_checked_slicing", since = "1.20.0")]
     #[inline]
     pub unsafe fn get_unchecked<I: SliceIndex<str>>(&self, i: I) -> &I::Output {
         core_str::StrExt::get_unchecked(self, i)
@@ -416,7 +413,6 @@ pub unsafe fn get_unchecked<I: SliceIndex<str>>(&self, i: I) -> &I::Output {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(str_checked_slicing)]
     /// let mut v = String::from("🗻∈🌏");
     /// unsafe {
     ///     assert_eq!("🗻", v.get_unchecked_mut(0..4));
@@ -424,7 +420,7 @@ pub unsafe fn get_unchecked<I: SliceIndex<str>>(&self, i: I) -> &I::Output {
     ///     assert_eq!("🌏", v.get_unchecked_mut(7..11));
     /// }
     /// ```
-    #[unstable(feature = "str_checked_slicing", issue = "39932")]
+    #[stable(feature = "str_checked_slicing", since = "1.20.0")]
     #[inline]
     pub unsafe fn get_unchecked_mut<I: SliceIndex<str>>(&mut self, i: I) -> &mut I::Output {
         core_str::StrExt::get_unchecked_mut(self, i)
index c6d70ee7575f8a6754159504da48bd1075d0e4f6..75ff781113722e940d06b33323fccb939be7855b 100644 (file)
@@ -24,7 +24,6 @@
 #![feature(repr_align)]
 #![feature(slice_rotate)]
 #![feature(splice)]
-#![feature(str_checked_slicing)]
 #![feature(str_escape)]
 #![feature(test)]
 #![feature(unboxed_closures)]
index 95b27751a6aaf973976cb4b2f69ebf9a03f0b4fd..0bbbf2352b4e6514fda19e3fbaab173bac799d36 100644 (file)
@@ -1776,7 +1776,7 @@ fn index_mut(&mut self, index: ops::RangeToInclusive<usize>) -> &mut str {
         }
     }
 
-    #[unstable(feature = "str_checked_slicing", issue = "39932")]
+    #[stable(feature = "str_checked_slicing", since = "1.20.0")]
     impl SliceIndex<str> for ops::RangeFull {
         type Output = str;
         #[inline]
@@ -1805,7 +1805,7 @@ fn index_mut(self, slice: &mut str) -> &mut Self::Output {
         }
     }
 
-    #[unstable(feature = "str_checked_slicing", issue = "39932")]
+    #[stable(feature = "str_checked_slicing", since = "1.20.0")]
     impl SliceIndex<str> for ops::Range<usize> {
         type Output = str;
         #[inline]
@@ -1859,7 +1859,7 @@ fn index_mut(self, slice: &mut str) -> &mut Self::Output {
         }
     }
 
-    #[unstable(feature = "str_checked_slicing", issue = "39932")]
+    #[stable(feature = "str_checked_slicing", since = "1.20.0")]
     impl SliceIndex<str> for ops::RangeTo<usize> {
         type Output = str;
         #[inline]
@@ -1904,7 +1904,7 @@ fn index_mut(self, slice: &mut str) -> &mut Self::Output {
         }
     }
 
-    #[unstable(feature = "str_checked_slicing", issue = "39932")]
+    #[stable(feature = "str_checked_slicing", since = "1.20.0")]
     impl SliceIndex<str> for ops::RangeFrom<usize> {
         type Output = str;
         #[inline]
@@ -1951,7 +1951,7 @@ fn index_mut(self, slice: &mut str) -> &mut Self::Output {
         }
     }
 
-    #[unstable(feature = "str_checked_slicing", issue = "39932")]
+    #[stable(feature = "str_checked_slicing", since = "1.20.0")]
     impl SliceIndex<str> for ops::RangeInclusive<usize> {
         type Output = str;
         #[inline]
@@ -1994,7 +1994,7 @@ fn index_mut(self, slice: &mut str) -> &mut Self::Output {
 
 
 
-    #[unstable(feature = "str_checked_slicing", issue = "39932")]
+    #[stable(feature = "str_checked_slicing", since = "1.20.0")]
     impl SliceIndex<str> for ops::RangeToInclusive<usize> {
         type Output = str;
         #[inline]
@@ -2094,13 +2094,13 @@ fn rmatch_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> RMatchIndices<'a, P>
     #[rustc_deprecated(since = "1.6.0", reason = "use lines() instead now")]
     #[allow(deprecated)]
     fn lines_any(&self) -> LinesAny;
-    #[unstable(feature = "str_checked_slicing", issue = "39932")]
+    #[stable(feature = "str_checked_slicing", since = "1.20.0")]
     fn get<I: SliceIndex<str>>(&self, i: I) -> Option<&I::Output>;
-    #[unstable(feature = "str_checked_slicing", issue = "39932")]
+    #[stable(feature = "str_checked_slicing", since = "1.20.0")]
     fn get_mut<I: SliceIndex<str>>(&mut self, i: I) -> Option<&mut I::Output>;
-    #[unstable(feature = "str_checked_slicing", issue = "39932")]
+    #[stable(feature = "str_checked_slicing", since = "1.20.0")]
     unsafe fn get_unchecked<I: SliceIndex<str>>(&self, i: I) -> &I::Output;
-    #[unstable(feature = "str_checked_slicing", issue = "39932")]
+    #[stable(feature = "str_checked_slicing", since = "1.20.0")]
     unsafe fn get_unchecked_mut<I: SliceIndex<str>>(&mut self, i: I) -> &mut I::Output;
     #[stable(feature = "core", since = "1.6.0")]
     unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &str;