@@ -280,8 +280,8 @@ impl<T: ?Sized> Arc<T> {
280
280
281
281
impl < T : ?Sized , A : Allocator > Arc < T , A > {
282
282
#[ inline]
283
- fn internal_into_inner_with_allocator ( self ) -> ( NonNull < ArcInner < T > > , A ) {
284
- let this = mem:: ManuallyDrop :: new ( self ) ;
283
+ fn into_inner_with_allocator ( this : Self ) -> ( NonNull < ArcInner < T > > , A ) {
284
+ let this = mem:: ManuallyDrop :: new ( this ) ;
285
285
( this. ptr , unsafe { ptr:: read ( & this. alloc ) } )
286
286
}
287
287
@@ -1282,7 +1282,7 @@ impl<T, A: Allocator> Arc<mem::MaybeUninit<T>, A> {
1282
1282
#[ must_use = "`self` will be dropped if the result is not used" ]
1283
1283
#[ inline]
1284
1284
pub unsafe fn assume_init ( self ) -> Arc < T , A > {
1285
- let ( ptr, alloc) = self . internal_into_inner_with_allocator ( ) ;
1285
+ let ( ptr, alloc) = Arc :: into_inner_with_allocator ( self ) ;
1286
1286
unsafe { Arc :: from_inner_in ( ptr. cast ( ) , alloc) }
1287
1287
}
1288
1288
}
@@ -1324,7 +1324,7 @@ impl<T, A: Allocator> Arc<[mem::MaybeUninit<T>], A> {
1324
1324
#[ must_use = "`self` will be dropped if the result is not used" ]
1325
1325
#[ inline]
1326
1326
pub unsafe fn assume_init ( self ) -> Arc < [ T ] , A > {
1327
- let ( ptr, alloc) = self . internal_into_inner_with_allocator ( ) ;
1327
+ let ( ptr, alloc) = Arc :: into_inner_with_allocator ( self ) ;
1328
1328
unsafe { Arc :: from_ptr_in ( ptr. as_ptr ( ) as _ , alloc) }
1329
1329
}
1330
1330
}
@@ -2488,7 +2488,7 @@ impl<A: Allocator> Arc<dyn Any + Send + Sync, A> {
2488
2488
{
2489
2489
if ( * self ) . is :: < T > ( ) {
2490
2490
unsafe {
2491
- let ( ptr, alloc) = self . internal_into_inner_with_allocator ( ) ;
2491
+ let ( ptr, alloc) = Arc :: into_inner_with_allocator ( self ) ;
2492
2492
Ok ( Arc :: from_inner_in ( ptr. cast ( ) , alloc) )
2493
2493
}
2494
2494
} else {
@@ -2529,7 +2529,7 @@ impl<A: Allocator> Arc<dyn Any + Send + Sync, A> {
2529
2529
T : Any + Send + Sync ,
2530
2530
{
2531
2531
unsafe {
2532
- let ( ptr, alloc) = self . internal_into_inner_with_allocator ( ) ;
2532
+ let ( ptr, alloc) = Arc :: into_inner_with_allocator ( self ) ;
2533
2533
Arc :: from_inner_in ( ptr. cast ( ) , alloc)
2534
2534
}
2535
2535
}
@@ -3491,7 +3491,7 @@ impl<T, A: Allocator, const N: usize> TryFrom<Arc<[T], A>> for Arc<[T; N], A> {
3491
3491
3492
3492
fn try_from ( boxed_slice : Arc < [ T ] , A > ) -> Result < Self , Self :: Error > {
3493
3493
if boxed_slice. len ( ) == N {
3494
- let ( ptr, alloc) = boxed_slice . internal_into_inner_with_allocator ( ) ;
3494
+ let ( ptr, alloc) = Arc :: into_inner_with_allocator ( boxed_slice ) ;
3495
3495
Ok ( unsafe { Arc :: from_inner_in ( ptr. cast ( ) , alloc) } )
3496
3496
} else {
3497
3497
Err ( boxed_slice)
0 commit comments