@@ -245,6 +245,7 @@ use core::any::Any;
245
245
use core:: cell:: Cell ;
246
246
#[ cfg( not( no_global_oom_handling) ) ]
247
247
use core:: clone:: CloneToUninit ;
248
+ use core:: clone:: UseCloned ;
248
249
use core:: cmp:: Ordering ;
249
250
use core:: hash:: { Hash , Hasher } ;
250
251
use core:: intrinsics:: abort;
@@ -2333,6 +2334,9 @@ impl<T: ?Sized, A: Allocator + Clone> Clone for Rc<T, A> {
2333
2334
}
2334
2335
}
2335
2336
2337
+ #[ unstable( feature = "ergonomic_clones" , issue = "132290" ) ]
2338
+ impl < T : ?Sized , A : Allocator + Clone > UseCloned for Rc < T , A > { }
2339
+
2336
2340
#[ cfg( not( no_global_oom_handling) ) ]
2337
2341
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2338
2342
impl < T : Default > Default for Rc < T > {
@@ -3496,6 +3500,9 @@ impl<T: ?Sized, A: Allocator + Clone> Clone for Weak<T, A> {
3496
3500
}
3497
3501
}
3498
3502
3503
+ #[ unstable( feature = "ergonomic_clones" , issue = "132290" ) ]
3504
+ impl < T : ?Sized , A : Allocator + Clone > UseCloned for Weak < T , A > { }
3505
+
3499
3506
#[ stable( feature = "rc_weak" , since = "1.4.0" ) ]
3500
3507
impl < T : ?Sized , A : Allocator > fmt:: Debug for Weak < T , A > {
3501
3508
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
0 commit comments