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 @@ -2226,6 +2226,27 @@ impl<T: Default> Default for Rc<T> {
2226
2226
}
2227
2227
}
2228
2228
2229
+ #[ cfg( not( no_global_oom_handling) ) ]
2230
+ #[ stable( feature = "more_rc_default_impls" , since = "CURRENT_RUSTC_VERSION" ) ]
2231
+ impl Default for Rc < str > {
2232
+ /// Creates an empty str inside an Rc
2233
+ #[ inline]
2234
+ fn default ( ) -> Self {
2235
+ Rc :: from ( "" )
2236
+ }
2237
+ }
2238
+
2239
+ #[ cfg( not( no_global_oom_handling) ) ]
2240
+ #[ stable( feature = "more_rc_default_impls" , since = "CURRENT_RUSTC_VERSION" ) ]
2241
+ impl < T > Default for Rc < [ T ] > {
2242
+ /// Creates an empty `[T]` inside an Rc
2243
+ #[ inline]
2244
+ fn default ( ) -> Self {
2245
+ let arr: [ T ; 0 ] = [ ] ;
2246
+ Rc :: from ( arr)
2247
+ }
2248
+ }
2249
+
2229
2250
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2230
2251
trait RcEqIdent < T : ?Sized + PartialEq , A : Allocator > {
2231
2252
fn eq ( & self , other : & Rc < T , A > ) -> bool ;
Original file line number Diff line number Diff line change @@ -3298,6 +3298,27 @@ impl<T: Default> Default for Arc<T> {
3298
3298
}
3299
3299
}
3300
3300
3301
+ #[ cfg( not( no_global_oom_handling) ) ]
3302
+ #[ stable( feature = "more_rc_default_impls" , since = "CURRENT_RUSTC_VERSION" ) ]
3303
+ impl Default for Arc < str > {
3304
+ /// Creates an empty str inside an Arc
3305
+ #[ inline]
3306
+ fn default ( ) -> Self {
3307
+ Arc :: from ( "" )
3308
+ }
3309
+ }
3310
+
3311
+ #[ cfg( not( no_global_oom_handling) ) ]
3312
+ #[ stable( feature = "more_rc_default_impls" , since = "CURRENT_RUSTC_VERSION" ) ]
3313
+ impl < T > Default for Arc < [ T ] > {
3314
+ /// Creates an empty `[T]` inside an Arc
3315
+ #[ inline]
3316
+ fn default ( ) -> Self {
3317
+ let arr: [ T ; 0 ] = [ ] ;
3318
+ Arc :: from ( arr)
3319
+ }
3320
+ }
3321
+
3301
3322
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
3302
3323
impl < T : ?Sized + Hash , A : Allocator > Hash for Arc < T , A > {
3303
3324
fn hash < H : Hasher > ( & self , state : & mut H ) {
You can’t perform that action at this time.
0 commit comments