@@ -318,8 +318,6 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
318
318
/// # Examples
319
319
///
320
320
/// ```
321
- /// #![feature(inclusive_range_methods)]
322
- ///
323
321
/// assert_eq!((3..=5), std::ops::RangeInclusive::new(3, 5));
324
322
/// assert_eq!(3 + 4 + 5, (3..=5).sum());
325
323
///
@@ -355,12 +353,11 @@ impl<Idx> RangeInclusive<Idx> {
355
353
/// # Examples
356
354
///
357
355
/// ```
358
- /// #![feature(inclusive_range_methods)]
359
356
/// use std::ops::RangeInclusive;
360
357
///
361
358
/// assert_eq!(3..=5, RangeInclusive::new(3, 5));
362
359
/// ```
363
- #[ unstable ( feature = "inclusive_range_methods" , issue = "49022 " ) ]
360
+ #[ stable ( feature = "inclusive_range_methods" , since = "1.27.0 " ) ]
364
361
#[ inline]
365
362
pub const fn new ( start : Idx , end : Idx ) -> Self {
366
363
Self { start, end }
@@ -373,17 +370,18 @@ impl<Idx> RangeInclusive<Idx> {
373
370
/// whether the inclusive range is empty, use the [`is_empty()`] method
374
371
/// instead of comparing `start() > end()`.
375
372
///
373
+ /// Note: the value returned by this method is unspecified after the range
374
+ /// has been iterated to exhaustion.
375
+ ///
376
376
/// [`end()`]: #method.end
377
377
/// [`is_empty()`]: #method.is_empty
378
378
///
379
379
/// # Examples
380
380
///
381
381
/// ```
382
- /// #![feature(inclusive_range_methods)]
383
- ///
384
382
/// assert_eq!((3..=5).start(), &3);
385
383
/// ```
386
- #[ unstable ( feature = "inclusive_range_methods" , issue = "49022 " ) ]
384
+ #[ stable ( feature = "inclusive_range_methods" , since = "1.27.0 " ) ]
387
385
#[ inline]
388
386
pub fn start ( & self ) -> & Idx {
389
387
& self . start
@@ -396,21 +394,38 @@ impl<Idx> RangeInclusive<Idx> {
396
394
/// whether the inclusive range is empty, use the [`is_empty()`] method
397
395
/// instead of comparing `start() > end()`.
398
396
///
397
+ /// Note: the value returned by this method is unspecified after the range
398
+ /// has been iterated to exhaustion.
399
+ ///
399
400
/// [`start()`]: #method.start
400
401
/// [`is_empty()`]: #method.is_empty
401
402
///
402
403
/// # Examples
403
404
///
404
405
/// ```
405
- /// #![feature(inclusive_range_methods)]
406
- ///
407
406
/// assert_eq!((3..=5).end(), &5);
408
407
/// ```
409
- #[ unstable ( feature = "inclusive_range_methods" , issue = "49022 " ) ]
408
+ #[ stable ( feature = "inclusive_range_methods" , since = "1.27.0 " ) ]
410
409
#[ inline]
411
410
pub fn end ( & self ) -> & Idx {
412
411
& self . end
413
412
}
413
+
414
+ /// Destructures the `RangeInclusive` into (lower bound, upper (inclusive) bound).
415
+ ///
416
+ /// Note: the value returned by this method is unspecified after the range
417
+ /// has been iterated to exhaustion.
418
+ ///
419
+ /// # Examples
420
+ ///
421
+ /// ```
422
+ /// assert_eq!((3..=5).into_inner(), (3, 5));
423
+ /// ```
424
+ #[ stable( feature = "inclusive_range_methods" , since = "1.27.0" ) ]
425
+ #[ inline]
426
+ pub fn into_inner ( self ) -> ( Idx , Idx ) {
427
+ ( self . start , self . end )
428
+ }
414
429
}
415
430
416
431
#[ stable( feature = "inclusive_range" , since = "1.26.0" ) ]
0 commit comments