@@ -2357,7 +2357,7 @@ impl<T: Default> Default for Rc<T> {
23572357 /// assert_eq!(*x, 0);
23582358 /// ```
23592359 #[ inline]
2360- fn default ( ) -> Rc < T > {
2360+ fn default ( ) -> Self {
23612361 unsafe {
23622362 Self :: from_inner (
23632363 Box :: leak ( Box :: write (
@@ -2373,7 +2373,7 @@ impl<T: Default> Default for Rc<T> {
23732373#[ cfg( not( no_global_oom_handling) ) ]
23742374#[ stable( feature = "more_rc_default_impls" , since = "1.80.0" ) ]
23752375impl Default for Rc < str > {
2376- /// Creates an empty str inside an Rc
2376+ /// Creates an empty ` str` inside an `Rc`.
23772377 ///
23782378 /// This may or may not share an allocation with other Rcs on the same thread.
23792379 #[ inline]
@@ -2387,7 +2387,7 @@ impl Default for Rc<str> {
23872387#[ cfg( not( no_global_oom_handling) ) ]
23882388#[ stable( feature = "more_rc_default_impls" , since = "1.80.0" ) ]
23892389impl < T > Default for Rc < [ T ] > {
2390- /// Creates an empty `[T]` inside an Rc
2390+ /// Creates an empty `[T]` inside an `Rc`.
23912391 ///
23922392 /// This may or may not share an allocation with other Rcs on the same thread.
23932393 #[ inline]
@@ -2397,6 +2397,19 @@ impl<T> Default for Rc<[T]> {
23972397 }
23982398}
23992399
2400+ #[ cfg( not( no_global_oom_handling) ) ]
2401+ #[ stable( feature = "pin_default_impls" , since = "CURRENT_RUSTC_VERSION" ) ]
2402+ impl < T > Default for Pin < Rc < T > >
2403+ where
2404+ T : ?Sized ,
2405+ Rc < T > : Default ,
2406+ {
2407+ #[ inline]
2408+ fn default ( ) -> Self {
2409+ unsafe { Pin :: new_unchecked ( Rc :: < T > :: default ( ) ) }
2410+ }
2411+ }
2412+
24002413#[ stable( feature = "rust1" , since = "1.0.0" ) ]
24012414trait RcEqIdent < T : ?Sized + PartialEq , A : Allocator > {
24022415 fn eq ( & self , other : & Rc < T , A > ) -> bool ;
0 commit comments