@@ -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
@@ -1290,7 +1290,7 @@ impl<T, A: Allocator> Arc<mem::MaybeUninit<T>, A> {
1290
1290
#[ must_use = "`self` will be dropped if the result is not used" ]
1291
1291
#[ inline]
1292
1292
pub unsafe fn assume_init ( self ) -> Arc < T , A > {
1293
- let ( ptr, alloc) = self . internal_into_inner_with_allocator ( ) ;
1293
+ let ( ptr, alloc) = Arc :: into_inner_with_allocator ( self ) ;
1294
1294
unsafe { Arc :: from_inner_in ( ptr. cast ( ) , alloc) }
1295
1295
}
1296
1296
}
@@ -1332,7 +1332,7 @@ impl<T, A: Allocator> Arc<[mem::MaybeUninit<T>], A> {
1332
1332
#[ must_use = "`self` will be dropped if the result is not used" ]
1333
1333
#[ inline]
1334
1334
pub unsafe fn assume_init ( self ) -> Arc < [ T ] , A > {
1335
- let ( ptr, alloc) = self . internal_into_inner_with_allocator ( ) ;
1335
+ let ( ptr, alloc) = Arc :: into_inner_with_allocator ( self ) ;
1336
1336
unsafe { Arc :: from_ptr_in ( ptr. as_ptr ( ) as _ , alloc) }
1337
1337
}
1338
1338
}
@@ -2499,7 +2499,7 @@ impl<A: Allocator> Arc<dyn Any + Send + Sync, A> {
2499
2499
{
2500
2500
if ( * self ) . is :: < T > ( ) {
2501
2501
unsafe {
2502
- let ( ptr, alloc) = self . internal_into_inner_with_allocator ( ) ;
2502
+ let ( ptr, alloc) = Arc :: into_inner_with_allocator ( self ) ;
2503
2503
Ok ( Arc :: from_inner_in ( ptr. cast ( ) , alloc) )
2504
2504
}
2505
2505
} else {
@@ -2540,7 +2540,7 @@ impl<A: Allocator> Arc<dyn Any + Send + Sync, A> {
2540
2540
T : Any + Send + Sync ,
2541
2541
{
2542
2542
unsafe {
2543
- let ( ptr, alloc) = self . internal_into_inner_with_allocator ( ) ;
2543
+ let ( ptr, alloc) = Arc :: into_inner_with_allocator ( self ) ;
2544
2544
Arc :: from_inner_in ( ptr. cast ( ) , alloc)
2545
2545
}
2546
2546
}
@@ -3506,7 +3506,7 @@ impl<T, A: Allocator, const N: usize> TryFrom<Arc<[T], A>> for Arc<[T; N], A> {
3506
3506
3507
3507
fn try_from ( boxed_slice : Arc < [ T ] , A > ) -> Result < Self , Self :: Error > {
3508
3508
if boxed_slice. len ( ) == N {
3509
- let ( ptr, alloc) = boxed_slice . internal_into_inner_with_allocator ( ) ;
3509
+ let ( ptr, alloc) = Arc :: into_inner_with_allocator ( boxed_slice ) ;
3510
3510
Ok ( unsafe { Arc :: from_inner_in ( ptr. cast ( ) , alloc) } )
3511
3511
} else {
3512
3512
Err ( boxed_slice)
0 commit comments