@@ -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
///
@@ -345,12 +343,11 @@ impl<Idx> RangeInclusive<Idx> {
345
343
/// # Examples
346
344
///
347
345
/// ```
348
- /// #![feature(inclusive_range_methods)]
349
346
/// use std::ops::RangeInclusive;
350
347
///
351
348
/// assert_eq!(3..=5, RangeInclusive::new(3, 5));
352
349
/// ```
353
- #[ unstable ( feature = "inclusive_range_methods" , issue = "49022 " ) ]
350
+ #[ stable ( feature = "inclusive_range_methods" , since = "1.27.0 " ) ]
354
351
#[ inline]
355
352
pub const fn new ( start : Idx , end : Idx ) -> Self {
356
353
Self { start, end }
@@ -363,17 +360,18 @@ impl<Idx> RangeInclusive<Idx> {
363
360
/// whether the inclusive range is empty, use the [`is_empty()`] method
364
361
/// instead of comparing `start() > end()`.
365
362
///
363
+ /// Note: the value returned by this method is unspecified after the range
364
+ /// has been iterated to exhaustion.
365
+ ///
366
366
/// [`end()`]: #method.end
367
367
/// [`is_empty()`]: #method.is_empty
368
368
///
369
369
/// # Examples
370
370
///
371
371
/// ```
372
- /// #![feature(inclusive_range_methods)]
373
- ///
374
372
/// assert_eq!((3..=5).start(), &3);
375
373
/// ```
376
- #[ unstable ( feature = "inclusive_range_methods" , issue = "49022 " ) ]
374
+ #[ stable ( feature = "inclusive_range_methods" , since = "1.27.0 " ) ]
377
375
#[ inline]
378
376
pub fn start ( & self ) -> & Idx {
379
377
& self . start
@@ -386,32 +384,34 @@ impl<Idx> RangeInclusive<Idx> {
386
384
/// whether the inclusive range is empty, use the [`is_empty()`] method
387
385
/// instead of comparing `start() > end()`.
388
386
///
387
+ /// Note: the value returned by this method is unspecified after the range
388
+ /// has been iterated to exhaustion.
389
+ ///
389
390
/// [`start()`]: #method.start
390
391
/// [`is_empty()`]: #method.is_empty
391
392
///
392
393
/// # Examples
393
394
///
394
395
/// ```
395
- /// #![feature(inclusive_range_methods)]
396
- ///
397
396
/// assert_eq!((3..=5).end(), &5);
398
397
/// ```
399
- #[ unstable ( feature = "inclusive_range_methods" , issue = "49022 " ) ]
398
+ #[ stable ( feature = "inclusive_range_methods" , since = "1.27.0 " ) ]
400
399
#[ inline]
401
400
pub fn end ( & self ) -> & Idx {
402
401
& self . end
403
402
}
404
403
405
- /// Destructures the RangeInclusive into (lower bound, upper (inclusive) bound).
404
+ /// Destructures the `RangeInclusive` into (lower bound, upper (inclusive) bound).
405
+ ///
406
+ /// Note: the value returned by this method is unspecified after the range
407
+ /// has been iterated to exhaustion.
406
408
///
407
409
/// # Examples
408
410
///
409
411
/// ```
410
- /// #![feature(inclusive_range_methods)]
411
- ///
412
412
/// assert_eq!((3..=5).into_inner(), (3, 5));
413
413
/// ```
414
- #[ unstable ( feature = "inclusive_range_methods" , issue = "49022 " ) ]
414
+ #[ stable ( feature = "inclusive_range_methods" , since = "1.27.0 " ) ]
415
415
#[ inline]
416
416
pub fn into_inner ( self ) -> ( Idx , Idx ) {
417
417
( self . start , self . end )
0 commit comments