Skip to content

Commit 17d52d0

Browse files
committed
Stabilize the inclusive_range lib feature
Stabilizes the lib feature for inclusive ranges, not the syntax yet as its still being discussed.
1 parent afb853a commit 17d52d0

18 files changed

+34
-82
lines changed

src/liballoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@
101101
#![feature(fused)]
102102
#![feature(generic_param_attrs)]
103103
#![feature(i128_type)]
104-
#![feature(inclusive_range)]
105104
#![feature(lang_items)]
106105
#![feature(manually_drop)]
107106
#![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.21.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.21.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
@@ -1771,7 +1771,7 @@ impl ops::Index<ops::RangeFull> for String {
17711771
unsafe { str::from_utf8_unchecked(&self.vec) }
17721772
}
17731773
}
1774-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
1774+
#[stable(feature = "inclusive_range", since = "1.21.0")]
17751775
impl ops::Index<ops::RangeInclusive<usize>> for String {
17761776
type Output = str;
17771777

@@ -1780,7 +1780,7 @@ impl ops::Index<ops::RangeInclusive<usize>> for String {
17801780
Index::index(&**self, index)
17811781
}
17821782
}
1783-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
1783+
#[stable(feature = "inclusive_range", since = "1.21.0")]
17841784
impl ops::Index<ops::RangeToInclusive<usize>> for String {
17851785
type Output = str;
17861786

@@ -1818,14 +1818,14 @@ impl ops::IndexMut<ops::RangeFull> for String {
18181818
unsafe { str::from_utf8_unchecked_mut(&mut *self.vec) }
18191819
}
18201820
}
1821-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
1821+
#[stable(feature = "inclusive_range", since = "1.21.0")]
18221822
impl ops::IndexMut<ops::RangeInclusive<usize>> for String {
18231823
#[inline]
18241824
fn index_mut(&mut self, index: ops::RangeInclusive<usize>) -> &mut str {
18251825
IndexMut::index_mut(&mut **self, index)
18261826
}
18271827
}
1828-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
1828+
#[stable(feature = "inclusive_range", since = "1.21.0")]
18291829
impl ops::IndexMut<ops::RangeToInclusive<usize>> for String {
18301830
#[inline]
18311831
fn index_mut(&mut self, index: ops::RangeToInclusive<usize>) -> &mut str {

src/liballoc/vec.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,7 @@ impl<T> ops::Index<ops::RangeFull> for Vec<T> {
16021602
self
16031603
}
16041604
}
1605-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
1605+
#[stable(feature = "inclusive_range", since = "1.21.0")]
16061606
impl<T> ops::Index<ops::RangeInclusive<usize>> for Vec<T> {
16071607
type Output = [T];
16081608

@@ -1611,7 +1611,7 @@ impl<T> ops::Index<ops::RangeInclusive<usize>> for Vec<T> {
16111611
Index::index(&**self, index)
16121612
}
16131613
}
1614-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
1614+
#[stable(feature = "inclusive_range", since = "1.21.0")]
16151615
impl<T> ops::Index<ops::RangeToInclusive<usize>> for Vec<T> {
16161616
type Output = [T];
16171617

@@ -1649,14 +1649,14 @@ impl<T> ops::IndexMut<ops::RangeFull> for Vec<T> {
16491649
self
16501650
}
16511651
}
1652-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
1652+
#[stable(feature = "inclusive_range", since = "1.21.0")]
16531653
impl<T> ops::IndexMut<ops::RangeInclusive<usize>> for Vec<T> {
16541654
#[inline]
16551655
fn index_mut(&mut self, index: ops::RangeInclusive<usize>) -> &mut [T] {
16561656
IndexMut::index_mut(&mut **self, index)
16571657
}
16581658
}
1659-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
1659+
#[stable(feature = "inclusive_range", since = "1.21.0")]
16601660
impl<T> ops::IndexMut<ops::RangeToInclusive<usize>> for Vec<T> {
16611661
#[inline]
16621662
fn index_mut(&mut self, index: ops::RangeToInclusive<usize>) -> &mut [T] {

src/libcore/iter/range.rs

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

254254
macro_rules! range_incl_exact_iter_impl {
255255
($($t:ty)*) => ($(
256-
#[unstable(feature = "inclusive_range",
257-
reason = "recently added, follows RFC",
258-
issue = "28237")]
256+
#[stable(feature = "inclusive_range", since = "1.21.0")]
259257
impl ExactSizeIterator for ops::RangeInclusive<$t> { }
260258
)*)
261259
}
@@ -269,9 +267,7 @@ macro_rules! range_trusted_len_impl {
269267

270268
macro_rules! range_incl_trusted_len_impl {
271269
($($t:ty)*) => ($(
272-
#[unstable(feature = "inclusive_range",
273-
reason = "recently added, follows RFC",
274-
issue = "28237")]
270+
#[stable(feature = "inclusive_range", since = "1.21.0")]
275271
unsafe impl TrustedLen for ops::RangeInclusive<$t> { }
276272
)*)
277273
}
@@ -359,7 +355,7 @@ impl<A: Step> Iterator for ops::RangeFrom<A> where
359355
impl<A> FusedIterator for ops::RangeFrom<A>
360356
where A: Step, for<'a> &'a A: Add<&'a A, Output = A> {}
361357

362-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
358+
#[stable(feature = "inclusive_range", since = "1.21.0")]
363359
impl<A: Step> Iterator for ops::RangeInclusive<A> where
364360
for<'a> &'a A: Add<&'a A, Output = A>
365361
{
@@ -396,7 +392,7 @@ impl<A: Step> Iterator for ops::RangeInclusive<A> where
396392
}
397393
}
398394

399-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
395+
#[stable(feature = "inclusive_range", since = "1.21.0")]
400396
impl<A: Step> DoubleEndedIterator for ops::RangeInclusive<A> where
401397
for<'a> &'a A: Add<&'a A, Output = A>,
402398
for<'a> &'a A: Sub<&'a A, Output = A>

src/libcore/ops/mod.rs

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

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

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

src/libcore/ops/range.rs

+9-15
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
240240
/// # Examples
241241
///
242242
/// ```
243-
/// #![feature(inclusive_range,inclusive_range_syntax)]
243+
/// #![feature(inclusive_range_syntax)]
244244
/// fn main() {
245245
/// assert_eq!((3...5), std::ops::RangeInclusive{ start: 3, end: 5 });
246246
/// assert_eq!(3+4+5, (3...5).sum());
@@ -251,21 +251,17 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
251251
/// }
252252
/// ```
253253
#[derive(Clone, PartialEq, Eq, Hash)] // not Copy -- see #27186
254-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
254+
#[stable(feature = "inclusive_range", since = "1.21.0")]
255255
pub struct RangeInclusive<Idx> {
256256
/// The lower bound of the range (inclusive).
257-
#[unstable(feature = "inclusive_range",
258-
reason = "recently added, follows RFC",
259-
issue = "28237")]
257+
#[stable(feature = "inclusive_range", since = "1.21.0")]
260258
pub start: Idx,
261259
/// The upper bound of the range (inclusive).
262-
#[unstable(feature = "inclusive_range",
263-
reason = "recently added, follows RFC",
264-
issue = "28237")]
260+
#[stable(feature = "inclusive_range", since = "1.21.0")]
265261
pub end: Idx,
266262
}
267263

268-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
264+
#[stable(feature = "inclusive_range", since = "1.21.0")]
269265
impl<Idx: fmt::Debug> fmt::Debug for RangeInclusive<Idx> {
270266
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
271267
write!(fmt, "{:?}...{:?}", self.start, self.end)
@@ -306,7 +302,7 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
306302
/// The `...{integer}` syntax is a `RangeToInclusive`:
307303
///
308304
/// ```
309-
/// #![feature(inclusive_range,inclusive_range_syntax)]
305+
/// #![feature(inclusive_range_syntax)]
310306
/// assert_eq!((...5), std::ops::RangeToInclusive{ end: 5 });
311307
/// ```
312308
///
@@ -330,16 +326,14 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
330326
/// assert_eq!(arr[1...2], [ 1,2 ]);
331327
/// ```
332328
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
333-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
329+
#[stable(feature = "inclusive_range", since = "1.21.0")]
334330
pub struct RangeToInclusive<Idx> {
335331
/// The upper bound of the range (inclusive)
336-
#[unstable(feature = "inclusive_range",
337-
reason = "recently added, follows RFC",
338-
issue = "28237")]
332+
#[stable(feature = "inclusive_range", since = "1.21.0")]
339333
pub end: Idx,
340334
}
341335

342-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
336+
#[stable(feature = "inclusive_range", since = "1.21.0")]
343337
impl<Idx: fmt::Debug> fmt::Debug for RangeToInclusive<Idx> {
344338
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
345339
write!(fmt, "...{:?}", self.end)

src/libcore/slice/mod.rs

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

991991

992-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
992+
#[stable(feature = "inclusive_range", since = "1.21.0")]
993993
impl<T> SliceIndex<[T]> for ops::RangeInclusive<usize> {
994994
type Output = [T];
995995

@@ -1030,7 +1030,7 @@ impl<T> SliceIndex<[T]> for ops::RangeInclusive<usize> {
10301030
}
10311031
}
10321032

1033-
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
1033+
#[stable(feature = "inclusive_range", since = "1.21.0")]
10341034
impl<T> SliceIndex<[T]> for ops::RangeToInclusive<usize> {
10351035
type Output = [T];
10361036

src/libcore/str/mod.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -1695,9 +1695,7 @@ mod traits {
16951695
}
16961696
}
16971697

1698-
#[unstable(feature = "inclusive_range",
1699-
reason = "recently added, follows RFC",
1700-
issue = "28237")]
1698+
#[stable(feature = "inclusive_range", since = "1.21.0")]
17011699
impl ops::Index<ops::RangeInclusive<usize>> for str {
17021700
type Output = str;
17031701

@@ -1707,9 +1705,7 @@ mod traits {
17071705
}
17081706
}
17091707

1710-
#[unstable(feature = "inclusive_range",
1711-
reason = "recently added, follows RFC",
1712-
issue = "28237")]
1708+
#[stable(feature = "inclusive_range", since = "1.21.0")]
17131709
impl ops::Index<ops::RangeToInclusive<usize>> for str {
17141710
type Output = str;
17151711

@@ -1719,18 +1715,14 @@ mod traits {
17191715
}
17201716
}
17211717

1722-
#[unstable(feature = "inclusive_range",
1723-
reason = "recently added, follows RFC",
1724-
issue = "28237")]
1718+
#[stable(feature = "inclusive_range", since = "1.21.0")]
17251719
impl ops::IndexMut<ops::RangeInclusive<usize>> for str {
17261720
#[inline]
17271721
fn index_mut(&mut self, index: ops::RangeInclusive<usize>) -> &mut str {
17281722
index.index_mut(self)
17291723
}
17301724
}
1731-
#[unstable(feature = "inclusive_range",
1732-
reason = "recently added, follows RFC",
1733-
issue = "28237")]
1725+
#[stable(feature = "inclusive_range", since = "1.21.0")]
17341726
impl ops::IndexMut<ops::RangeToInclusive<usize>> for str {
17351727
#[inline]
17361728
fn index_mut(&mut self, index: ops::RangeToInclusive<usize>) -> &mut str {

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(iter_rfind)]
2827
#![feature(libc)]
2928
#![feature(nonzero)]

src/libstd/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@
269269
#![feature(heap_api)]
270270
#![feature(i128)]
271271
#![feature(i128_type)]
272-
#![feature(inclusive_range)]
273272
#![feature(int_error_internals)]
274273
#![feature(integer_atomics)]
275274
#![feature(into_cow)]

src/test/compile-fail/range_inclusive_gate.rs

-23
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
// FIXME #34229 duplicated errors

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_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)