@@ -245,6 +245,7 @@ use core::any::Any;
245245use core:: cell:: Cell ;
246246#[ cfg( not( no_global_oom_handling) ) ]
247247use core:: clone:: CloneToUninit ;
248+ use core:: clone:: UseCloned ;
248249use core:: cmp:: Ordering ;
249250use core:: hash:: { Hash , Hasher } ;
250251use core:: intrinsics:: abort;
@@ -2333,6 +2334,9 @@ impl<T: ?Sized, A: Allocator + Clone> Clone for Rc<T, A> {
23332334 }
23342335}
23352336
2337+ #[ unstable( feature = "ergonomic_clones" , issue = "132290" ) ]
2338+ impl < T : ?Sized , A : Allocator + Clone > UseCloned for Rc < T , A > { }
2339+
23362340#[ cfg( not( no_global_oom_handling) ) ]
23372341#[ stable( feature = "rust1" , since = "1.0.0" ) ]
23382342impl < T : Default > Default for Rc < T > {
@@ -3496,6 +3500,9 @@ impl<T: ?Sized, A: Allocator + Clone> Clone for Weak<T, A> {
34963500 }
34973501}
34983502
3503+ #[ unstable( feature = "ergonomic_clones" , issue = "132290" ) ]
3504+ impl < T : ?Sized , A : Allocator + Clone > UseCloned for Weak < T , A > { }
3505+
34993506#[ stable( feature = "rc_weak" , since = "1.4.0" ) ]
35003507impl < T : ?Sized , A : Allocator > fmt:: Debug for Weak < T , A > {
35013508 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
0 commit comments