@@ -2357,7 +2357,7 @@ impl<T: Default> Default for Rc<T> {
2357
2357
/// assert_eq!(*x, 0);
2358
2358
/// ```
2359
2359
#[ inline]
2360
- fn default ( ) -> Rc < T > {
2360
+ fn default ( ) -> Self {
2361
2361
unsafe {
2362
2362
Self :: from_inner (
2363
2363
Box :: leak ( Box :: write (
@@ -2373,7 +2373,7 @@ impl<T: Default> Default for Rc<T> {
2373
2373
#[ cfg( not( no_global_oom_handling) ) ]
2374
2374
#[ stable( feature = "more_rc_default_impls" , since = "1.80.0" ) ]
2375
2375
impl Default for Rc < str > {
2376
- /// Creates an empty str inside an Rc
2376
+ /// Creates an empty ` str` inside an `Rc`.
2377
2377
///
2378
2378
/// This may or may not share an allocation with other Rcs on the same thread.
2379
2379
#[ inline]
@@ -2387,7 +2387,7 @@ impl Default for Rc<str> {
2387
2387
#[ cfg( not( no_global_oom_handling) ) ]
2388
2388
#[ stable( feature = "more_rc_default_impls" , since = "1.80.0" ) ]
2389
2389
impl < T > Default for Rc < [ T ] > {
2390
- /// Creates an empty `[T]` inside an Rc
2390
+ /// Creates an empty `[T]` inside an `Rc`.
2391
2391
///
2392
2392
/// This may or may not share an allocation with other Rcs on the same thread.
2393
2393
#[ inline]
@@ -2397,6 +2397,19 @@ impl<T> Default for Rc<[T]> {
2397
2397
}
2398
2398
}
2399
2399
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
+
2400
2413
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2401
2414
trait RcEqIdent < T : ?Sized + PartialEq , A : Allocator > {
2402
2415
fn eq ( & self , other : & Rc < T , A > ) -> bool ;
0 commit comments