8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- #![ unstable( feature = "collections_range" ,
12
- reason = "waiting for dust to settle on inclusive ranges" ,
13
- issue = "30877" ) ]
14
11
15
12
//! Range syntax.
16
13
@@ -19,6 +16,7 @@ use Bound::{self, Excluded, Included, Unbounded};
19
16
20
17
/// `RangeArgument` is implemented by Rust's built-in range types, produced
21
18
/// by range syntax like `..`, `a..`, `..b` or `c..d`.
19
+ #[ stable( feature = "collections_range" , since = "1.22.0" ) ]
22
20
pub trait RangeArgument < T : ?Sized > {
23
21
/// Start index bound.
24
22
///
@@ -28,7 +26,6 @@ pub trait RangeArgument<T: ?Sized> {
28
26
///
29
27
/// ```
30
28
/// #![feature(alloc)]
31
- /// #![feature(collections_range)]
32
29
///
33
30
/// extern crate alloc;
34
31
///
@@ -40,6 +37,7 @@ pub trait RangeArgument<T: ?Sized> {
40
37
/// assert_eq!((3..10).start(), Included(&3));
41
38
/// # }
42
39
/// ```
40
+ #[ stable( feature = "collections_range" , since = "1.22.0" ) ]
43
41
fn start ( & self ) -> Bound < & T > ;
44
42
45
43
/// End index bound.
@@ -50,7 +48,6 @@ pub trait RangeArgument<T: ?Sized> {
50
48
///
51
49
/// ```
52
50
/// #![feature(alloc)]
53
- /// #![feature(collections_range)]
54
51
///
55
52
/// extern crate alloc;
56
53
///
@@ -62,11 +59,13 @@ pub trait RangeArgument<T: ?Sized> {
62
59
/// assert_eq!((3..10).end(), Excluded(&10));
63
60
/// # }
64
61
/// ```
62
+ #[ stable( feature = "collections_range" , since = "1.22.0" ) ]
65
63
fn end ( & self ) -> Bound < & T > ;
66
64
}
67
65
68
66
// FIXME add inclusive ranges to RangeArgument
69
67
68
+ #[ stable( feature = "collections_range" , since = "1.22.0" ) ]
70
69
impl < T : ?Sized > RangeArgument < T > for RangeFull {
71
70
fn start ( & self ) -> Bound < & T > {
72
71
Unbounded
@@ -76,6 +75,7 @@ impl<T: ?Sized> RangeArgument<T> for RangeFull {
76
75
}
77
76
}
78
77
78
+ #[ stable( feature = "collections_range" , since = "1.22.0" ) ]
79
79
impl < T > RangeArgument < T > for RangeFrom < T > {
80
80
fn start ( & self ) -> Bound < & T > {
81
81
Included ( & self . start )
@@ -85,6 +85,7 @@ impl<T> RangeArgument<T> for RangeFrom<T> {
85
85
}
86
86
}
87
87
88
+ #[ stable( feature = "collections_range" , since = "1.22.0" ) ]
88
89
impl < T > RangeArgument < T > for RangeTo < T > {
89
90
fn start ( & self ) -> Bound < & T > {
90
91
Unbounded
@@ -94,6 +95,7 @@ impl<T> RangeArgument<T> for RangeTo<T> {
94
95
}
95
96
}
96
97
98
+ #[ stable( feature = "collections_range" , since = "1.22.0" ) ]
97
99
impl < T > RangeArgument < T > for Range < T > {
98
100
fn start ( & self ) -> Bound < & T > {
99
101
Included ( & self . start )
0 commit comments