@@ -363,6 +363,7 @@ impl<T> Rc<T> {
363
363
#[ unstable( feature = "rc_would_unwrap" ,
364
364
reason = "just added for niche usecase" ,
365
365
issue = "28356" ) ]
366
+ #[ rustc_deprecated( since = "1.15.0" , reason = "too niche; use `strong_count` instead" ) ]
366
367
pub fn would_unwrap ( this : & Self ) -> bool {
367
368
Rc :: strong_count ( & this) == 1
368
369
}
@@ -482,8 +483,6 @@ impl<T: ?Sized> Rc<T> {
482
483
/// # Examples
483
484
///
484
485
/// ```
485
- /// #![feature(rc_counts)]
486
- ///
487
486
/// use std::rc::Rc;
488
487
///
489
488
/// let five = Rc::new(5);
@@ -492,8 +491,7 @@ impl<T: ?Sized> Rc<T> {
492
491
/// assert_eq!(1, Rc::weak_count(&five));
493
492
/// ```
494
493
#[ inline]
495
- #[ unstable( feature = "rc_counts" , reason = "not clearly useful" ,
496
- issue = "28356" ) ]
494
+ #[ stable( feature = "rc_counts" , since = "1.15.0" ) ]
497
495
pub fn weak_count ( this : & Self ) -> usize {
498
496
this. weak ( ) - 1
499
497
}
@@ -503,8 +501,6 @@ impl<T: ?Sized> Rc<T> {
503
501
/// # Examples
504
502
///
505
503
/// ```
506
- /// #![feature(rc_counts)]
507
- ///
508
504
/// use std::rc::Rc;
509
505
///
510
506
/// let five = Rc::new(5);
@@ -513,8 +509,7 @@ impl<T: ?Sized> Rc<T> {
513
509
/// assert_eq!(2, Rc::strong_count(&five));
514
510
/// ```
515
511
#[ inline]
516
- #[ unstable( feature = "rc_counts" , reason = "not clearly useful" ,
517
- issue = "28356" ) ]
512
+ #[ stable( feature = "rc_counts" , since = "1.15.0" ) ]
518
513
pub fn strong_count ( this : & Self ) -> usize {
519
514
this. strong ( )
520
515
}
@@ -538,6 +533,8 @@ impl<T: ?Sized> Rc<T> {
538
533
#[ inline]
539
534
#[ unstable( feature = "rc_counts" , reason = "uniqueness has unclear meaning" ,
540
535
issue = "28356" ) ]
536
+ #[ rustc_deprecated( since = "1.15.0" ,
537
+ reason = "too niche; use `strong_count` and `weak_count` instead" ) ]
541
538
pub fn is_unique ( this : & Self ) -> bool {
542
539
Rc :: weak_count ( this) == 0 && Rc :: strong_count ( this) == 1
543
540
}
0 commit comments