@@ -35,7 +35,7 @@ use core::{borrow, fmt, hint};
3535
3636#[ cfg( not( no_global_oom_handling) ) ]
3737use crate :: alloc:: handle_alloc_error;
38- use crate :: alloc:: { AllocError , Allocator , Global , Layout } ;
38+ use crate :: alloc:: { AllocError , Allocator , AllocatorClone , Global , Layout } ;
3939use crate :: borrow:: { Cow , ToOwned } ;
4040use crate :: boxed:: Box ;
4141use crate :: rc:: is_dangling;
@@ -1931,7 +1931,7 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
19311931 #[ stable( feature = "arc_weak" , since = "1.4.0" ) ]
19321932 pub fn downgrade ( this : & Self ) -> Weak < T , A >
19331933 where
1934- A : Clone ,
1934+ A : AllocatorClone ,
19351935 {
19361936 // This Relaxed is OK because we're checking the value in the CAS
19371937 // below.
@@ -2062,7 +2062,7 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
20622062 #[ unstable( feature = "allocator_api" , issue = "32838" ) ]
20632063 pub unsafe fn increment_strong_count_in ( ptr : * const T , alloc : A )
20642064 where
2065- A : Clone ,
2065+ A : AllocatorClone ,
20662066 {
20672067 // Retain Arc, but don't touch refcount by wrapping in ManuallyDrop
20682068 let arc = unsafe { mem:: ManuallyDrop :: new ( Arc :: from_raw_in ( ptr, alloc) ) } ;
@@ -2250,7 +2250,7 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
22502250
22512251 // Free the allocation without dropping its contents
22522252 let ( bptr, alloc) = Box :: into_raw_with_allocator ( src) ;
2253- let src = Box :: from_raw_in ( bptr as * mut mem:: ManuallyDrop < T > , alloc. by_ref ( ) ) ;
2253+ let src = Box :: from_raw_in ( bptr as * mut mem:: ManuallyDrop < T > , & alloc) ;
22542254 drop ( src) ;
22552255
22562256 Self :: from_ptr_in ( ptr, alloc)
@@ -2376,7 +2376,7 @@ impl<T: TrivialClone> ArcFromSlice<T> for Arc<[T]> {
23762376}
23772377
23782378#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2379- impl < T : ?Sized , A : Allocator + Clone > Clone for Arc < T , A > {
2379+ impl < T : ?Sized , A : AllocatorClone > Clone for Arc < T , A > {
23802380 /// Makes a clone of the `Arc` pointer.
23812381 ///
23822382 /// This creates another pointer to the same allocation, increasing the
@@ -2430,10 +2430,10 @@ impl<T: ?Sized, A: Allocator + Clone> Clone for Arc<T, A> {
24302430}
24312431
24322432#[ unstable( feature = "ergonomic_clones" , issue = "132290" ) ]
2433- impl < T : ?Sized , A : Allocator + Clone > UseCloned for Arc < T , A > { }
2433+ impl < T : ?Sized , A : AllocatorClone > UseCloned for Arc < T , A > { }
24342434
24352435#[ unstable( feature = "share_trait" , issue = "156756" ) ]
2436- impl < T : ?Sized , A : Allocator + Clone > Share for Arc < T , A > { }
2436+ impl < T : ?Sized , A : AllocatorClone > Share for Arc < T , A > { }
24372437
24382438#[ stable( feature = "rust1" , since = "1.0.0" ) ]
24392439impl < T : ?Sized , A : Allocator > Deref for Arc < T , A > {
@@ -2455,7 +2455,7 @@ unsafe impl<T: ?Sized, A: Allocator> DerefPure for Arc<T, A> {}
24552455impl < T : ?Sized > LegacyReceiver for Arc < T > { }
24562456
24572457#[ cfg( not( no_global_oom_handling) ) ]
2458- impl < T : ?Sized + CloneToUninit , A : Allocator + Clone > Arc < T , A > {
2458+ impl < T : ?Sized + CloneToUninit , A : AllocatorClone > Arc < T , A > {
24592459 /// Makes a mutable reference into the given `Arc`.
24602460 ///
24612461 /// If there are other `Arc` pointers to the same allocation, then `make_mut` will
@@ -3274,7 +3274,7 @@ impl<T: ?Sized, A: Allocator> Weak<T, A> {
32743274 #[ stable( feature = "arc_weak" , since = "1.4.0" ) ]
32753275 pub fn upgrade ( & self ) -> Option < Arc < T , A > >
32763276 where
3277- A : Clone ,
3277+ A : AllocatorClone ,
32783278 {
32793279 #[ inline]
32803280 fn checked_increment ( n : usize ) -> Option < usize > {
@@ -3409,7 +3409,7 @@ impl<T: ?Sized, A: Allocator> Weak<T, A> {
34093409}
34103410
34113411#[ stable( feature = "arc_weak" , since = "1.4.0" ) ]
3412- impl < T : ?Sized , A : Allocator + Clone > Clone for Weak < T , A > {
3412+ impl < T : ?Sized , A : AllocatorClone > Clone for Weak < T , A > {
34133413 /// Makes a clone of the `Weak` pointer that points to the same allocation.
34143414 ///
34153415 /// # Examples
@@ -3441,7 +3441,7 @@ impl<T: ?Sized, A: Allocator + Clone> Clone for Weak<T, A> {
34413441}
34423442
34433443#[ unstable( feature = "ergonomic_clones" , issue = "132290" ) ]
3444- impl < T : ?Sized , A : Allocator + Clone > UseCloned for Weak < T , A > { }
3444+ impl < T : ?Sized , A : AllocatorClone > UseCloned for Weak < T , A > { }
34453445
34463446#[ stable( feature = "downgraded_weak" , since = "1.10.0" ) ]
34473447impl < T > Default for Weak < T > {
@@ -4029,7 +4029,7 @@ impl<T: ?Sized, A: Allocator> From<Box<T, A>> for Arc<T, A> {
40294029
40304030#[ cfg( not( no_global_oom_handling) ) ]
40314031#[ stable( feature = "shared_from_slice" , since = "1.21.0" ) ]
4032- impl < T , A : Allocator + Clone > From < Vec < T , A > > for Arc < [ T ] , A > {
4032+ impl < T , A : AllocatorClone > From < Vec < T , A > > for Arc < [ T ] , A > {
40334033 /// Allocates a reference-counted slice and moves `v`'s items into it.
40344034 ///
40354035 /// # Example
@@ -4839,7 +4839,7 @@ impl<T: ?Sized, A: Allocator> UniqueArc<T, A> {
48394839 }
48404840}
48414841
4842- impl < T : ?Sized , A : Allocator + Clone > UniqueArc < T , A > {
4842+ impl < T : ?Sized , A : AllocatorClone > UniqueArc < T , A > {
48434843 /// Creates a new weak reference to the `UniqueArc`.
48444844 ///
48454845 /// Attempting to upgrade this weak reference will fail before the `UniqueArc` has been converted
0 commit comments