This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree 3 files changed +64
-0
lines changed 3 files changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -910,6 +910,28 @@ impl From<&CStr> for Rc<CStr> {
910
910
}
911
911
}
912
912
913
+ #[ cfg( not( no_global_oom_handling) ) ]
914
+ #[ stable( feature = "more_rc_default_impls" , since = "CURRENT_RUSTC_VERSION" ) ]
915
+ impl Default for Arc < CStr > {
916
+ /// Creates an empty CStr inside an Arc
917
+ #[ inline]
918
+ fn default ( ) -> Self {
919
+ let c_str: & CStr = Default :: default ( ) ;
920
+ Arc :: from ( c_str)
921
+ }
922
+ }
923
+
924
+ #[ cfg( not( no_global_oom_handling) ) ]
925
+ #[ stable( feature = "more_rc_default_impls" , since = "CURRENT_RUSTC_VERSION" ) ]
926
+ impl Default for Rc < CStr > {
927
+ /// Creates an empty CStr inside an Rc
928
+ #[ inline]
929
+ fn default ( ) -> Self {
930
+ let c_str: & CStr = Default :: default ( ) ;
931
+ Rc :: from ( c_str)
932
+ }
933
+ }
934
+
913
935
#[ cfg( not( test) ) ]
914
936
#[ stable( feature = "default_box_extra" , since = "1.17.0" ) ]
915
937
impl Default for Box < CStr > {
Original file line number Diff line number Diff line change @@ -2224,6 +2224,27 @@ impl<T: Default> Default for Rc<T> {
2224
2224
}
2225
2225
}
2226
2226
2227
+ #[ cfg( not( no_global_oom_handling) ) ]
2228
+ #[ stable( feature = "more_rc_default_impls" , since = "CURRENT_RUSTC_VERSION" ) ]
2229
+ impl Default for Rc < str > {
2230
+ /// Creates an empty str inside an Rc
2231
+ #[ inline]
2232
+ fn default ( ) -> Self {
2233
+ Rc :: from ( "" )
2234
+ }
2235
+ }
2236
+
2237
+ #[ cfg( not( no_global_oom_handling) ) ]
2238
+ #[ stable( feature = "more_rc_default_impls" , since = "CURRENT_RUSTC_VERSION" ) ]
2239
+ impl < T > Default for Rc < [ T ] > {
2240
+ /// Creates an empty `[T]` inside an Rc
2241
+ #[ inline]
2242
+ fn default ( ) -> Self {
2243
+ let arr: [ T ; 0 ] = [ ] ;
2244
+ Rc :: from ( arr)
2245
+ }
2246
+ }
2247
+
2227
2248
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2228
2249
trait RcEqIdent < T : ?Sized + PartialEq , A : Allocator > {
2229
2250
fn eq ( & self , other : & Rc < T , A > ) -> bool ;
Original file line number Diff line number Diff line change @@ -3300,6 +3300,27 @@ impl<T: Default> Default for Arc<T> {
3300
3300
}
3301
3301
}
3302
3302
3303
+ #[ cfg( not( no_global_oom_handling) ) ]
3304
+ #[ stable( feature = "more_rc_default_impls" , since = "CURRENT_RUSTC_VERSION" ) ]
3305
+ impl Default for Arc < str > {
3306
+ /// Creates an empty str inside an Arc
3307
+ #[ inline]
3308
+ fn default ( ) -> Self {
3309
+ Arc :: from ( "" )
3310
+ }
3311
+ }
3312
+
3313
+ #[ cfg( not( no_global_oom_handling) ) ]
3314
+ #[ stable( feature = "more_rc_default_impls" , since = "CURRENT_RUSTC_VERSION" ) ]
3315
+ impl < T > Default for Arc < [ T ] > {
3316
+ /// Creates an empty `[T]` inside an Arc
3317
+ #[ inline]
3318
+ fn default ( ) -> Self {
3319
+ let arr: [ T ; 0 ] = [ ] ;
3320
+ Arc :: from ( arr)
3321
+ }
3322
+ }
3323
+
3303
3324
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
3304
3325
impl < T : ?Sized + Hash , A : Allocator > Hash for Arc < T , A > {
3305
3326
fn hash < H : Hasher > ( & self , state : & mut H ) {
You can’t perform that action at this time.
0 commit comments