@@ -128,7 +128,7 @@ impl<Idx: PartialOrd<Idx>> Range<Idx> {
128
128
/// The range is empty if either side is incomparable:
129
129
///
130
130
/// ```
131
- /// #![feature(range_is_empty,inclusive_range_syntax )]
131
+ /// #![feature(range_is_empty)]
132
132
///
133
133
/// use std::f32::NAN;
134
134
/// assert!(!(3.0..5.0).is_empty());
@@ -283,7 +283,7 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
283
283
/// # Examples
284
284
///
285
285
/// ```
286
- /// #![feature(inclusive_range,inclusive_range_syntax )]
286
+ /// #![feature(inclusive_range_fields )]
287
287
///
288
288
/// assert_eq!((3..=5), std::ops::RangeInclusive { start: 3, end: 5 });
289
289
/// assert_eq!(3 + 4 + 5, (3..=5).sum());
@@ -293,21 +293,17 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
293
293
/// assert_eq!(arr[1..=2], [ 1,2 ]); // RangeInclusive
294
294
/// ```
295
295
#[ 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 " ) ]
297
297
pub struct RangeInclusive < Idx > {
298
298
/// The lower bound of the range (inclusive).
299
- #[ unstable( feature = "inclusive_range" ,
300
- reason = "recently added, follows RFC" ,
301
- issue = "28237" ) ]
299
+ #[ unstable( feature = "inclusive_range_fields" , issue = "49022" ) ]
302
300
pub start : Idx ,
303
301
/// The upper bound of the range (inclusive).
304
- #[ unstable( feature = "inclusive_range" ,
305
- reason = "recently added, follows RFC" ,
306
- issue = "28237" ) ]
302
+ #[ unstable( feature = "inclusive_range_fields" , issue = "49022" ) ]
307
303
pub end : Idx ,
308
304
}
309
305
310
- #[ unstable ( feature = "inclusive_range" , reason = "recently added, follows RFC" , issue = "28237 ") ]
306
+ #[ stable ( feature = "inclusive_range" , since = "1.26.0 " ) ]
311
307
impl < Idx : fmt:: Debug > fmt:: Debug for RangeInclusive < Idx > {
312
308
fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
313
309
write ! ( fmt, "{:?}..={:?}" , self . start, self . end)
@@ -320,7 +316,7 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
320
316
/// # Examples
321
317
///
322
318
/// ```
323
- /// #![feature(range_contains,inclusive_range_syntax )]
319
+ /// #![feature(range_contains)]
324
320
///
325
321
/// assert!(!(3..=5).contains(2));
326
322
/// assert!( (3..=5).contains(3));
@@ -341,7 +337,7 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
341
337
/// # Examples
342
338
///
343
339
/// ```
344
- /// #![feature(range_is_empty,inclusive_range_syntax )]
340
+ /// #![feature(range_is_empty)]
345
341
///
346
342
/// assert!(!(3..=5).is_empty());
347
343
/// assert!(!(3..=3).is_empty());
@@ -351,7 +347,7 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
351
347
/// The range is empty if either side is incomparable:
352
348
///
353
349
/// ```
354
- /// #![feature(range_is_empty,inclusive_range_syntax )]
350
+ /// #![feature(range_is_empty)]
355
351
///
356
352
/// use std::f32::NAN;
357
353
/// assert!(!(3.0..=5.0).is_empty());
@@ -362,7 +358,7 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
362
358
/// This method returns `true` after iteration has finished:
363
359
///
364
360
/// ```
365
- /// #![feature(range_is_empty,inclusive_range_syntax )]
361
+ /// #![feature(range_is_empty)]
366
362
///
367
363
/// let mut r = 3..=5;
368
364
/// for _ in r.by_ref() {}
@@ -385,16 +381,13 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
385
381
/// The `..=end` syntax is a `RangeToInclusive`:
386
382
///
387
383
/// ```
388
- /// #![feature(inclusive_range,inclusive_range_syntax)]
389
384
/// assert_eq!((..=5), std::ops::RangeToInclusive{ end: 5 });
390
385
/// ```
391
386
///
392
387
/// It does not have an [`IntoIterator`] implementation, so you can't use it in a
393
388
/// `for` loop directly. This won't compile:
394
389
///
395
390
/// ```compile_fail,E0277
396
- /// #![feature(inclusive_range_syntax)]
397
- ///
398
391
/// // error[E0277]: the trait bound `std::ops::RangeToInclusive<{integer}>:
399
392
/// // std::iter::Iterator` is not satisfied
400
393
/// for i in ..=5 {
@@ -406,8 +399,6 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
406
399
/// array elements up to and including the index indicated by `end`.
407
400
///
408
401
/// ```
409
- /// #![feature(inclusive_range_syntax)]
410
- ///
411
402
/// let arr = [0, 1, 2, 3];
412
403
/// assert_eq!(arr[ ..=2], [0,1,2 ]); // RangeToInclusive
413
404
/// assert_eq!(arr[1..=2], [ 1,2 ]);
@@ -417,16 +408,14 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
417
408
/// [`Iterator`]: ../iter/trait.IntoIterator.html
418
409
/// [slicing index]: ../slice/trait.SliceIndex.html
419
410
#[ derive( Copy , Clone , PartialEq , Eq , Hash ) ]
420
- #[ unstable ( feature = "inclusive_range" , reason = "recently added, follows RFC" , issue = "28237 ") ]
411
+ #[ stable ( feature = "inclusive_range" , since = "1.26.0 " ) ]
421
412
pub struct RangeToInclusive < Idx > {
422
413
/// The upper bound of the range (inclusive)
423
- #[ unstable( feature = "inclusive_range" ,
424
- reason = "recently added, follows RFC" ,
425
- issue = "28237" ) ]
414
+ #[ stable( feature = "inclusive_range" , since = "1.26.0" ) ]
426
415
pub end : Idx ,
427
416
}
428
417
429
- #[ unstable ( feature = "inclusive_range" , reason = "recently added, follows RFC" , issue = "28237 ") ]
418
+ #[ stable ( feature = "inclusive_range" , since = "1.26.0 " ) ]
430
419
impl < Idx : fmt:: Debug > fmt:: Debug for RangeToInclusive < Idx > {
431
420
fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
432
421
write ! ( fmt, "..={:?}" , self . end)
@@ -440,7 +429,7 @@ impl<Idx: PartialOrd<Idx>> RangeToInclusive<Idx> {
440
429
/// # Examples
441
430
///
442
431
/// ```
443
- /// #![feature(range_contains,inclusive_range_syntax )]
432
+ /// #![feature(range_contains)]
444
433
///
445
434
/// assert!( (..=5).contains(-1_000_000_000));
446
435
/// assert!( (..=5).contains(5));
0 commit comments