88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11- // FIXME(27718): rc_counts stuff is useful internally, but was previously public
1211#![ allow( deprecated) ]
1312
1413//! Thread-local reference-counted boxes (the `Rc<T>` type).
9493//! documentation for more details on interior mutability.
9594//!
9695//! ```rust
97- //! #![feature(rc_weak)]
98- //!
9996//! use std::rc::Rc;
10097//! use std::rc::Weak;
10198//! use std::cell::RefCell;
@@ -242,7 +239,7 @@ impl<T> Rc<T> {
242239 /// assert_eq!(Rc::try_unwrap(x), Err(Rc::new(4)));
243240 /// ```
244241 #[ inline]
245- #[ unstable ( feature = "rc_unique" , reason= "needs FCP" , issue = "27718 " ) ]
242+ #[ stable ( feature = "rc_unique" , since = "1.4.0 " ) ]
246243 pub fn try_unwrap ( this : Self ) -> Result < T , Self > {
247244 if Rc :: would_unwrap ( & this) {
248245 unsafe {
@@ -263,8 +260,9 @@ impl<T> Rc<T> {
263260 }
264261
265262 /// Checks if `Rc::try_unwrap` would return `Ok`.
266- #[ unstable( feature = "rc_would_unwrap" , reason = "just added for niche usecase" ,
267- issue = "27718" ) ]
263+ #[ unstable( feature = "rc_would_unwrap" ,
264+ reason = "just added for niche usecase" ,
265+ issue = "28356" ) ]
268266 pub fn would_unwrap ( this : & Self ) -> bool {
269267 Rc :: strong_count ( & this) == 1
270268 }
@@ -276,28 +274,28 @@ impl<T: ?Sized> Rc<T> {
276274 /// # Examples
277275 ///
278276 /// ```
279- /// #![feature(rc_weak)]
280- ///
281277 /// use std::rc::Rc;
282278 ///
283279 /// let five = Rc::new(5);
284280 ///
285281 /// let weak_five = Rc::downgrade(&five);
286282 /// ```
287- #[ unstable ( feature = "rc_weak" , reason = "needs FCP" , issue = "27718 ") ]
283+ #[ stable ( feature = "rc_weak" , since = "1.4.0 " ) ]
288284 pub fn downgrade ( this : & Self ) -> Weak < T > {
289285 this. inc_weak ( ) ;
290286 Weak { _ptr : this. _ptr }
291287 }
292288
293289 /// Get the number of weak references to this value.
294290 #[ inline]
295- #[ unstable( feature = "rc_counts" , reason = "not clearly useful" , issue = "27718" ) ]
291+ #[ unstable( feature = "rc_counts" , reason = "not clearly useful" ,
292+ issue = "28356" ) ]
296293 pub fn weak_count ( this : & Self ) -> usize { this. weak ( ) - 1 }
297294
298295 /// Get the number of strong references to this value.
299296 #[ inline]
300- #[ unstable( feature = "rc_counts" , reason = "not clearly useful" , issue = "27718" ) ]
297+ #[ unstable( feature = "rc_counts" , reason = "not clearly useful" ,
298+ issue = "28356" ) ]
301299 pub fn strong_count ( this : & Self ) -> usize { this. strong ( ) }
302300
303301 /// Returns true if there are no other `Rc` or `Weak<T>` values that share
@@ -315,7 +313,8 @@ impl<T: ?Sized> Rc<T> {
315313 /// assert!(Rc::is_unique(&five));
316314 /// ```
317315 #[ inline]
318- #[ unstable( feature = "rc_counts" , reason = "uniqueness has unclear meaning" , issue = "27718" ) ]
316+ #[ unstable( feature = "rc_counts" , reason = "uniqueness has unclear meaning" ,
317+ issue = "28356" ) ]
319318 pub fn is_unique ( this : & Self ) -> bool {
320319 Rc :: weak_count ( this) == 0 && Rc :: strong_count ( this) == 1
321320 }
@@ -328,8 +327,6 @@ impl<T: ?Sized> Rc<T> {
328327 /// # Examples
329328 ///
330329 /// ```
331- /// #![feature(rc_unique)]
332- ///
333330 /// use std::rc::Rc;
334331 ///
335332 /// let mut x = Rc::new(3);
@@ -340,7 +337,7 @@ impl<T: ?Sized> Rc<T> {
340337 /// assert!(Rc::get_mut(&mut x).is_none());
341338 /// ```
342339 #[ inline]
343- #[ unstable ( feature = "rc_unique" , reason = "needs FCP" , issue = "27718 ") ]
340+ #[ stable ( feature = "rc_unique" , since = "1.4.0 " ) ]
344341 pub fn get_mut ( this : & mut Self ) -> Option < & mut T > {
345342 if Rc :: is_unique ( this) {
346343 let inner = unsafe { & mut * * this. _ptr } ;
@@ -353,7 +350,8 @@ impl<T: ?Sized> Rc<T> {
353350
354351impl < T : Clone > Rc < T > {
355352 #[ inline]
356- #[ unstable( feature = "rc_unique" , reason = "renamed to Rc::make_mut" , issue = "27718" ) ]
353+ #[ unstable( feature = "rc_make_unique" , reason = "renamed to Rc::make_mut" ,
354+ issue = "27718" ) ]
357355 #[ deprecated( since = "1.4.0" , reason = "renamed to Rc::make_mut" ) ]
358356 pub fn make_unique ( & mut self ) -> & mut T {
359357 Rc :: make_mut ( self )
@@ -385,7 +383,7 @@ impl<T: Clone> Rc<T> {
385383 ///
386384 /// ```
387385 #[ inline]
388- #[ unstable ( feature = "rc_unique" , reason = "needs FCP" , issue = "27718 ") ]
386+ #[ stable ( feature = "rc_unique" , since = "1.4.0 " ) ]
389387 pub fn make_mut ( this : & mut Self ) -> & mut T {
390388 if Rc :: strong_count ( this) != 1 {
391389 // Gotta clone the data, there are other Rcs
@@ -693,7 +691,7 @@ impl<T> fmt::Pointer for Rc<T> {
693691///
694692/// See the [module level documentation](./index.html) for more.
695693#[ unsafe_no_drop_flag]
696- #[ unstable ( feature = "rc_weak" , reason = "needs FCP" , issue = "27718 ") ]
694+ #[ stable ( feature = "rc_weak" , since = "1.4.0 " ) ]
697695pub struct Weak < T : ?Sized > {
698696 // FIXME #12808: strange names to try to avoid interfering with
699697 // field accesses of the contained type via Deref
@@ -716,8 +714,6 @@ impl<T: ?Sized> Weak<T> {
716714 /// # Examples
717715 ///
718716 /// ```
719- /// #![feature(rc_weak)]
720- ///
721717 /// use std::rc::Rc;
722718 ///
723719 /// let five = Rc::new(5);
@@ -726,7 +722,7 @@ impl<T: ?Sized> Weak<T> {
726722 ///
727723 /// let strong_five: Option<Rc<_>> = weak_five.upgrade();
728724 /// ```
729- #[ unstable ( feature = "rc_weak" , reason = "needs FCP" , issue = "27718 ") ]
725+ #[ stable ( feature = "rc_weak" , since = "1.4.0 " ) ]
730726 pub fn upgrade ( & self ) -> Option < Rc < T > > {
731727 if self . strong ( ) == 0 {
732728 None
@@ -746,8 +742,6 @@ impl<T: ?Sized> Drop for Weak<T> {
746742 /// # Examples
747743 ///
748744 /// ```
749- /// #![feature(rc_weak)]
750- ///
751745 /// use std::rc::Rc;
752746 ///
753747 /// {
@@ -783,7 +777,7 @@ impl<T: ?Sized> Drop for Weak<T> {
783777 }
784778}
785779
786- #[ unstable ( feature = "rc_weak" , reason = "needs FCP" , issue = "27718 ") ]
780+ #[ stable ( feature = "rc_weak" , since = "1.4.0 " ) ]
787781impl < T : ?Sized > Clone for Weak < T > {
788782
789783 /// Makes a clone of the `Weak<T>`.
@@ -793,8 +787,6 @@ impl<T: ?Sized> Clone for Weak<T> {
793787 /// # Examples
794788 ///
795789 /// ```
796- /// #![feature(rc_weak)]
797- ///
798790 /// use std::rc::Rc;
799791 ///
800792 /// let weak_five = Rc::downgrade(&Rc::new(5));
0 commit comments