File tree Expand file tree Collapse file tree 4 files changed +84
-0
lines changed Expand file tree Collapse file tree 4 files changed +84
-0
lines changed Original file line number Diff line number Diff line change @@ -909,6 +909,28 @@ impl From<&CStr> for Rc<CStr> {
909
909
}
910
910
}
911
911
912
+ #[ cfg( not( no_global_oom_handling) ) ]
913
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
914
+ impl Default for Arc < CStr > {
915
+ /// Creates an empty CStr inside an Arc
916
+ #[ inline]
917
+ fn default ( ) -> Self {
918
+ let c_str: & CStr = Default :: default ( ) ;
919
+ Arc :: from ( c_str)
920
+ }
921
+ }
922
+
923
+ #[ cfg( not( no_global_oom_handling) ) ]
924
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
925
+ impl Default for Rc < CStr > {
926
+ /// Creates an empty CStr inside an Rc
927
+ #[ inline]
928
+ fn default ( ) -> Self {
929
+ let c_str: & CStr = Default :: default ( ) ;
930
+ Rc :: from ( c_str)
931
+ }
932
+ }
933
+
912
934
#[ cfg( not( test) ) ]
913
935
#[ stable( feature = "default_box_extra" , since = "1.17.0" ) ]
914
936
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 = "rust1" , since = "1.0.0" ) ]
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 = "rust1" , since = "1.0.0" ) ]
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 = "rust1" , since = "1.0.0" ) ]
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 = "rust1" , since = "1.0.0" ) ]
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 ) {
Original file line number Diff line number Diff line change @@ -1346,6 +1346,26 @@ impl Default for &OsStr {
1346
1346
}
1347
1347
}
1348
1348
1349
+ #[ stable( feature = "shared_from_slice2" , since = "1.24.0" ) ]
1350
+ impl Default for Arc < OsStr > {
1351
+ /// Creates an empty OsStr inside an Arc
1352
+ #[ inline]
1353
+ fn default ( ) -> Self {
1354
+ let os_str: & OsStr = Default :: default ( ) ;
1355
+ Arc :: from ( os_str)
1356
+ }
1357
+ }
1358
+
1359
+ #[ stable( feature = "shared_from_slice2" , since = "1.24.0" ) ]
1360
+ impl Default for Rc < OsStr > {
1361
+ /// Creates an empty OsStr inside an Rc
1362
+ #[ inline]
1363
+ fn default ( ) -> Self {
1364
+ let os_str: & OsStr = Default :: default ( ) ;
1365
+ Rc :: from ( os_str)
1366
+ }
1367
+ }
1368
+
1349
1369
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1350
1370
impl PartialEq for OsStr {
1351
1371
#[ inline]
You can’t perform that action at this time.
0 commit comments