about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-03-15 16:00:40 +0000
committerbors <bors@rust-lang.org>2018-03-15 16:00:40 +0000
commit39264539448e7ec5e98067859db71685393a4464 (patch)
tree6a492ca09f4ca864ab619a0dc97565680bcd1030 /src/liballoc
parentff2d506c2c748bd218f74c6014abc4cecc8c74c4 (diff)
parent939cfa251aeb34b4b1a11396af1a3396792c708d (diff)
downloadrust-39264539448e7ec5e98067859db71685393a4464.tar.gz
rust-39264539448e7ec5e98067859db71685393a4464.zip
Auto merge of #47813 - kennytm:stable-incl-range, r=nrc
Stabilize inclusive range (`..=`)

Stabilize the followings:

* `inclusive_range` — The `std::ops::RangeInclusive` and `std::ops::RangeInclusiveTo` types, except its fields (tracked by #49022 separately).
* `inclusive_range_syntax` — The `a..=b` and `..=b` expression syntax
* `dotdoteq_in_patterns` — Using `a..=b` in a pattern

cc #28237
r? @rust-lang/lang
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/lib.rs2
-rw-r--r--src/liballoc/range.rs4
-rw-r--r--src/liballoc/string.rs8
-rw-r--r--src/liballoc/tests/lib.rs3
4 files changed, 9 insertions, 8 deletions
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index b93e128d508..2727bcaa28a 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -98,7 +98,6 @@
 #![feature(fundamental)]
 #![feature(generic_param_attrs)]
 #![feature(i128_type)]
-#![feature(inclusive_range)]
 #![feature(iter_rfold)]
 #![feature(lang_items)]
 #![feature(needs_allocator)]
@@ -125,6 +124,7 @@
 #![feature(on_unimplemented)]
 #![feature(exact_chunks)]
 #![feature(pointer_methods)]
+#![feature(inclusive_range_fields)]
 
 #![cfg_attr(not(test), feature(fn_traits, placement_new_protocol, swap_with_slice, i128))]
 #![cfg_attr(test, feature(test, box_heap))]
diff --git a/src/liballoc/range.rs b/src/liballoc/range.rs
index f862da0d61e..b03abc85180 100644
--- a/src/liballoc/range.rs
+++ b/src/liballoc/range.rs
@@ -103,7 +103,7 @@ impl<T> RangeArgument<T> for Range<T> {
     }
 }
 
-#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
+#[stable(feature = "inclusive_range", since = "1.26.0")]
 impl<T> RangeArgument<T> for RangeInclusive<T> {
     fn start(&self) -> Bound<&T> {
         Included(&self.start)
@@ -113,7 +113,7 @@ impl<T> RangeArgument<T> for RangeInclusive<T> {
     }
 }
 
-#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
+#[stable(feature = "inclusive_range", since = "1.26.0")]
 impl<T> RangeArgument<T> for RangeToInclusive<T> {
     fn start(&self) -> Bound<&T> {
         Unbounded
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs
index dcc81417346..9fec9091498 100644
--- a/src/liballoc/string.rs
+++ b/src/liballoc/string.rs
@@ -1950,7 +1950,7 @@ impl ops::Index<ops::RangeFull> for String {
         unsafe { str::from_utf8_unchecked(&self.vec) }
     }
 }
-#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
+#[stable(feature = "inclusive_range", since = "1.26.0")]
 impl ops::Index<ops::RangeInclusive<usize>> for String {
     type Output = str;
 
@@ -1959,7 +1959,7 @@ impl ops::Index<ops::RangeInclusive<usize>> for String {
         Index::index(&**self, index)
     }
 }
-#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
+#[stable(feature = "inclusive_range", since = "1.26.0")]
 impl ops::Index<ops::RangeToInclusive<usize>> for String {
     type Output = str;
 
@@ -1997,14 +1997,14 @@ impl ops::IndexMut<ops::RangeFull> for String {
         unsafe { str::from_utf8_unchecked_mut(&mut *self.vec) }
     }
 }
-#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
+#[stable(feature = "inclusive_range", since = "1.26.0")]
 impl ops::IndexMut<ops::RangeInclusive<usize>> for String {
     #[inline]
     fn index_mut(&mut self, index: ops::RangeInclusive<usize>) -> &mut str {
         IndexMut::index_mut(&mut **self, index)
     }
 }
-#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
+#[stable(feature = "inclusive_range", since = "1.26.0")]
 impl ops::IndexMut<ops::RangeToInclusive<usize>> for String {
     #[inline]
     fn index_mut(&mut self, index: ops::RangeToInclusive<usize>) -> &mut str {
diff --git a/src/liballoc/tests/lib.rs b/src/liballoc/tests/lib.rs
index 285cba0270c..bcd2ef27605 100644
--- a/src/liballoc/tests/lib.rs
+++ b/src/liballoc/tests/lib.rs
@@ -14,7 +14,7 @@
 #![feature(alloc_system)]
 #![feature(attr_literals)]
 #![feature(box_syntax)]
-#![feature(inclusive_range_syntax)]
+#![cfg_attr(stage0, feature(inclusive_range_syntax))]
 #![feature(collection_placement)]
 #![feature(const_fn)]
 #![feature(drain_filter)]
@@ -30,6 +30,7 @@
 #![feature(unboxed_closures)]
 #![feature(unicode)]
 #![feature(exact_chunks)]
+#![feature(inclusive_range_fields)]
 
 extern crate alloc_system;
 extern crate std_unicode;