Skip to content

Commit b5913f2

Browse files
committed
Stabilize inclusive_range library feature.
Stabilize std::ops::RangeInclusive and std::ops::RangeInclusiveTo.
1 parent 5ebf748 commit b5913f2

File tree

21 files changed

+33
-86
lines changed

21 files changed

+33
-86
lines changed

src/liballoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898
#![feature(fundamental)]
9999
#![feature(generic_param_attrs)]
100100
#![feature(i128_type)]
101-
#![feature(inclusive_range)]
102101
#![feature(iter_rfold)]
103102
#![feature(lang_items)]
104103
#![feature(needs_allocator)]

src/liballoc/range.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl<T> RangeArgument<T> for Range<T> {
103103
}
104104
}
105105

106-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
106+
#[stable(feature = "inclusive_range", since = "1.26.0")]
107107
impl<T> RangeArgument<T> for RangeInclusive<T> {
108108
fn start(&self) -> Bound<&T> {
109109
Included(&self.start)
@@ -113,7 +113,7 @@ impl<T> RangeArgument<T> for RangeInclusive<T> {
113113
}
114114
}
115115

116-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
116+
#[stable(feature = "inclusive_range", since = "1.26.0")]
117117
impl<T> RangeArgument<T> for RangeToInclusive<T> {
118118
fn start(&self) -> Bound<&T> {
119119
Unbounded

src/liballoc/string.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1876,7 +1876,7 @@ impl ops::Index<ops::RangeFull> for String {
18761876
unsafe { str::from_utf8_unchecked(&self.vec) }
18771877
}
18781878
}
1879-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
1879+
#[stable(feature = "inclusive_range", since = "1.26.0")]
18801880
impl ops::Index<ops::RangeInclusive<usize>> for String {
18811881
type Output = str;
18821882

@@ -1885,7 +1885,7 @@ impl ops::Index<ops::RangeInclusive<usize>> for String {
18851885
Index::index(&**self, index)
18861886
}
18871887
}
1888-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
1888+
#[stable(feature = "inclusive_range", since = "1.26.0")]
18891889
impl ops::Index<ops::RangeToInclusive<usize>> for String {
18901890
type Output = str;
18911891

@@ -1923,14 +1923,14 @@ impl ops::IndexMut<ops::RangeFull> for String {
19231923
unsafe { str::from_utf8_unchecked_mut(&mut *self.vec) }
19241924
}
19251925
}
1926-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
1926+
#[stable(feature = "inclusive_range", since = "1.26.0")]
19271927
impl ops::IndexMut<ops::RangeInclusive<usize>> for String {
19281928
#[inline]
19291929
fn index_mut(&mut self, index: ops::RangeInclusive<usize>) -> &mut str {
19301930
IndexMut::index_mut(&mut **self, index)
19311931
}
19321932
}
1933-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
1933+
#[stable(feature = "inclusive_range", since = "1.26.0")]
19341934
impl ops::IndexMut<ops::RangeToInclusive<usize>> for String {
19351935
#[inline]
19361936
fn index_mut(&mut self, index: ops::RangeToInclusive<usize>) -> &mut str {

src/libcore/iter/range.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,7 @@ macro_rules! range_exact_iter_impl {
186186

187187
macro_rules! range_incl_exact_iter_impl {
188188
($($t:ty)*) => ($(
189-
#[unstable(feature = "inclusive_range",
190-
reason = "recently added, follows RFC",
191-
issue = "28237")]
189+
#[stable(feature = "inclusive_range", since = "1.26.0")]
192190
impl ExactSizeIterator for ops::RangeInclusive<$t> { }
193191
)*)
194192
}
@@ -202,9 +200,7 @@ macro_rules! range_trusted_len_impl {
202200

203201
macro_rules! range_incl_trusted_len_impl {
204202
($($t:ty)*) => ($(
205-
#[unstable(feature = "inclusive_range",
206-
reason = "recently added, follows RFC",
207-
issue = "28237")]
203+
#[stable(feature = "inclusive_range", since = "1.26.0")]
208204
unsafe impl TrustedLen for ops::RangeInclusive<$t> { }
209205
)*)
210206
}
@@ -328,7 +324,7 @@ impl<A: Step> FusedIterator for ops::RangeFrom<A> {}
328324
#[unstable(feature = "trusted_len", issue = "37572")]
329325
unsafe impl<A: Step> TrustedLen for ops::RangeFrom<A> {}
330326

331-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
327+
#[stable(feature = "inclusive_range", since = "1.26.0")]
332328
impl<A: Step> Iterator for ops::RangeInclusive<A> {
333329
type Item = A;
334330

@@ -422,7 +418,7 @@ impl<A: Step> Iterator for ops::RangeInclusive<A> {
422418
}
423419
}
424420

425-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
421+
#[stable(feature = "inclusive_range", since = "1.26.0")]
426422
impl<A: Step> DoubleEndedIterator for ops::RangeInclusive<A> {
427423
#[inline]
428424
fn next_back(&mut self) -> Option<A> {

src/libcore/ops/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub use self::index::{Index, IndexMut};
191191
#[stable(feature = "rust1", since = "1.0.0")]
192192
pub use self::range::{Range, RangeFrom, RangeFull, RangeTo};
193193

194-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
194+
#[stable(feature = "inclusive_range", since = "1.26.0")]
195195
pub use self::range::{RangeInclusive, RangeToInclusive};
196196

197197
#[unstable(feature = "try_trait", issue = "42327")]

src/libcore/ops/range.rs

+9-15
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
283283
/// # Examples
284284
///
285285
/// ```
286-
/// #![feature(inclusive_range,inclusive_range_syntax)]
286+
/// #![feature(inclusive_range_syntax)]
287287
///
288288
/// assert_eq!((3..=5), std::ops::RangeInclusive { start: 3, end: 5 });
289289
/// assert_eq!(3 + 4 + 5, (3..=5).sum());
@@ -293,21 +293,17 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
293293
/// assert_eq!(arr[1..=2], [ 1,2 ]); // RangeInclusive
294294
/// ```
295295
#[derive(Clone, PartialEq, Eq, Hash)] // not Copy -- see #27186
296-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
296+
#[stable(feature = "inclusive_range", since = "1.26.0")]
297297
pub struct RangeInclusive<Idx> {
298298
/// The lower bound of the range (inclusive).
299-
#[unstable(feature = "inclusive_range",
300-
reason = "recently added, follows RFC",
301-
issue = "28237")]
299+
#[stable(feature = "inclusive_range", since = "1.26.0")]
302300
pub start: Idx,
303301
/// The upper bound of the range (inclusive).
304-
#[unstable(feature = "inclusive_range",
305-
reason = "recently added, follows RFC",
306-
issue = "28237")]
302+
#[stable(feature = "inclusive_range", since = "1.26.0")]
307303
pub end: Idx,
308304
}
309305

310-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
306+
#[stable(feature = "inclusive_range", since = "1.26.0")]
311307
impl<Idx: fmt::Debug> fmt::Debug for RangeInclusive<Idx> {
312308
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
313309
write!(fmt, "{:?}..={:?}", self.start, self.end)
@@ -385,7 +381,7 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
385381
/// The `..=end` syntax is a `RangeToInclusive`:
386382
///
387383
/// ```
388-
/// #![feature(inclusive_range,inclusive_range_syntax)]
384+
/// #![feature(inclusive_range_syntax)]
389385
/// assert_eq!((..=5), std::ops::RangeToInclusive{ end: 5 });
390386
/// ```
391387
///
@@ -417,16 +413,14 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
417413
/// [`Iterator`]: ../iter/trait.IntoIterator.html
418414
/// [slicing index]: ../slice/trait.SliceIndex.html
419415
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
420-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
416+
#[stable(feature = "inclusive_range", since = "1.26.0")]
421417
pub struct RangeToInclusive<Idx> {
422418
/// The upper bound of the range (inclusive)
423-
#[unstable(feature = "inclusive_range",
424-
reason = "recently added, follows RFC",
425-
issue = "28237")]
419+
#[stable(feature = "inclusive_range", since = "1.26.0")]
426420
pub end: Idx,
427421
}
428422

429-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
423+
#[stable(feature = "inclusive_range", since = "1.26.0")]
430424
impl<Idx: fmt::Debug> fmt::Debug for RangeToInclusive<Idx> {
431425
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
432426
write!(fmt, "..={:?}", self.end)

src/libcore/slice/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ impl<T> SliceIndex<[T]> for ops::RangeFull {
10391039
}
10401040

10411041

1042-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
1042+
#[stable(feature = "inclusive_range", since = "1.26.0")]
10431043
impl<T> SliceIndex<[T]> for ops::RangeInclusive<usize> {
10441044
type Output = [T];
10451045

@@ -1080,7 +1080,7 @@ impl<T> SliceIndex<[T]> for ops::RangeInclusive<usize> {
10801080
}
10811081
}
10821082

1083-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
1083+
#[stable(feature = "inclusive_range", since = "1.26.0")]
10841084
impl<T> SliceIndex<[T]> for ops::RangeToInclusive<usize> {
10851085
type Output = [T];
10861086

src/libcore/str/mod.rs

+6-18
Original file line numberDiff line numberDiff line change
@@ -1779,9 +1779,7 @@ mod traits {
17791779
}
17801780
}
17811781

1782-
#[unstable(feature = "inclusive_range",
1783-
reason = "recently added, follows RFC",
1784-
issue = "28237")]
1782+
#[stable(feature = "inclusive_range", since = "1.26.0")]
17851783
impl ops::Index<ops::RangeInclusive<usize>> for str {
17861784
type Output = str;
17871785

@@ -1791,9 +1789,7 @@ mod traits {
17911789
}
17921790
}
17931791

1794-
#[unstable(feature = "inclusive_range",
1795-
reason = "recently added, follows RFC",
1796-
issue = "28237")]
1792+
#[stable(feature = "inclusive_range", since = "1.26.0")]
17971793
impl ops::Index<ops::RangeToInclusive<usize>> for str {
17981794
type Output = str;
17991795

@@ -1803,18 +1799,14 @@ mod traits {
18031799
}
18041800
}
18051801

1806-
#[unstable(feature = "inclusive_range",
1807-
reason = "recently added, follows RFC",
1808-
issue = "28237")]
1802+
#[stable(feature = "inclusive_range", since = "1.26.0")]
18091803
impl ops::IndexMut<ops::RangeInclusive<usize>> for str {
18101804
#[inline]
18111805
fn index_mut(&mut self, index: ops::RangeInclusive<usize>) -> &mut str {
18121806
index.index_mut(self)
18131807
}
18141808
}
1815-
#[unstable(feature = "inclusive_range",
1816-
reason = "recently added, follows RFC",
1817-
issue = "28237")]
1809+
#[stable(feature = "inclusive_range", since = "1.26.0")]
18181810
impl ops::IndexMut<ops::RangeToInclusive<usize>> for str {
18191811
#[inline]
18201812
fn index_mut(&mut self, index: ops::RangeToInclusive<usize>) -> &mut str {
@@ -1997,9 +1989,7 @@ mod traits {
19971989
}
19981990
}
19991991

2000-
#[unstable(feature = "inclusive_range",
2001-
reason = "recently added, follows RFC",
2002-
issue = "28237")]
1992+
#[stable(feature = "inclusive_range", since = "1.26.0")]
20031993
impl SliceIndex<str> for ops::RangeInclusive<usize> {
20041994
type Output = str;
20051995
#[inline]
@@ -2042,9 +2032,7 @@ mod traits {
20422032

20432033

20442034

2045-
#[unstable(feature = "inclusive_range",
2046-
reason = "recently added, follows RFC",
2047-
issue = "28237")]
2035+
#[stable(feature = "inclusive_range", since = "1.26.0")]
20482036
impl SliceIndex<str> for ops::RangeToInclusive<usize> {
20492037
type Output = str;
20502038
#[inline]

src/libcore/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#![feature(fmt_internals)]
2424
#![feature(iterator_step_by)]
2525
#![feature(i128_type)]
26-
#![feature(inclusive_range)]
2726
#![feature(inclusive_range_syntax)]
2827
#![feature(iterator_try_fold)]
2928
#![feature(iterator_flatten)]

src/librustc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
#![feature(fs_read_write)]
5555
#![feature(i128)]
5656
#![feature(i128_type)]
57-
#![feature(inclusive_range)]
5857
#![feature(inclusive_range_syntax)]
5958
#![cfg_attr(windows, feature(libc))]
6059
#![feature(match_default_bindings)]

src/librustc_mir/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
2929
#![feature(fs_read_write)]
3030
#![feature(i128_type)]
3131
#![feature(inclusive_range_syntax)]
32-
#![feature(inclusive_range)]
3332
#![feature(macro_vis_matcher)]
3433
#![feature(match_default_bindings)]
3534
#![feature(exhaustive_patterns)]

src/librustc_trans/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#![allow(unused_attributes)]
2727
#![feature(i128_type)]
2828
#![feature(i128)]
29-
#![feature(inclusive_range)]
3029
#![feature(inclusive_range_syntax)]
3130
#![feature(libc)]
3231
#![feature(quote)]

src/libstd/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@
271271
#![feature(heap_api)]
272272
#![feature(i128)]
273273
#![feature(i128_type)]
274-
#![feature(inclusive_range)]
275274
#![feature(int_error_internals)]
276275
#![feature(integer_atomics)]
277276
#![feature(into_cow)]

src/test/compile-fail/range_inclusive_gate.rs

-21
This file was deleted.

src/test/compile-fail/range_traits-1.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(inclusive_range)]
12-
1311
use std::ops::*;
1412

1513
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]

src/test/compile-fail/range_traits-6.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(inclusive_range)]
12-
1311
use std::ops::*;
1412

1513
#[derive(Copy, Clone)] //~ ERROR Copy

src/test/compile-fail/range_traits-7.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(rustc_attrs, inclusive_range)]
11+
#![feature(rustc_attrs)]
1212

1313
use std::ops::*;
1414

src/test/parse-fail/range_inclusive.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Make sure that inclusive ranges with no end point don't parse.
1212

13-
#![feature(inclusive_range_syntax, inclusive_range)]
13+
#![feature(inclusive_range_syntax)]
1414

1515
pub fn main() {
1616
for _ in 1..= {} //~ERROR inclusive range with no end

src/test/parse-fail/range_inclusive_dotdotdot.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// Make sure that inclusive ranges with `...` syntax don't parse.
1414

15-
#![feature(inclusive_range_syntax, inclusive_range)]
15+
#![feature(inclusive_range_syntax)]
1616

1717
use std::ops::RangeToInclusive;
1818

src/test/parse-fail/range_inclusive_gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// Make sure that #![feature(inclusive_range_syntax)] is required.
1414

15-
// #![feature(inclusive_range_syntax, inclusive_range)]
15+
// #![feature(inclusive_range_syntax)]
1616

1717
macro_rules! m {
1818
() => { for _ in 1..=10 {} } //~ ERROR inclusive range syntax is experimental

src/test/run-pass/range_inclusive.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Test inclusive range syntax.
1212

13-
#![feature(inclusive_range_syntax, inclusive_range, iterator_step_by)]
13+
#![feature(inclusive_range_syntax, iterator_step_by)]
1414

1515
use std::ops::{RangeInclusive, RangeToInclusive};
1616

0 commit comments

Comments
 (0)