@@ -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
}
@@ -2440,7 +2440,7 @@ impl<A: Allocator> Arc<dyn Any + Send + Sync, A> {
2440
2440
{
2441
2441
if ( * self ) . is :: < T > ( ) {
2442
2442
unsafe {
2443
- let ( ptr, alloc) = self . internal_into_inner_with_allocator ( ) ;
2443
+ let ( ptr, alloc) = Arc :: into_inner_with_allocator ( self ) ;
2444
2444
Ok ( Arc :: from_inner_in ( ptr. cast ( ) , alloc) )
2445
2445
}
2446
2446
} else {
@@ -2481,7 +2481,7 @@ impl<A: Allocator> Arc<dyn Any + Send + Sync, A> {
2481
2481
T : Any + Send + Sync ,
2482
2482
{
2483
2483
unsafe {
2484
- let ( ptr, alloc) = self . internal_into_inner_with_allocator ( ) ;
2484
+ let ( ptr, alloc) = Arc :: into_inner_with_allocator ( self ) ;
2485
2485
Arc :: from_inner_in ( ptr. cast ( ) , alloc)
2486
2486
}
2487
2487
}
@@ -3443,7 +3443,7 @@ impl<T, A: Allocator, const N: usize> TryFrom<Arc<[T], A>> for Arc<[T; N], A> {
3443
3443
3444
3444
fn try_from ( boxed_slice : Arc < [ T ] , A > ) -> Result < Self , Self :: Error > {
3445
3445
if boxed_slice. len ( ) == N {
3446
- let ( ptr, alloc) = boxed_slice . internal_into_inner_with_allocator ( ) ;
3446
+ let ( ptr, alloc) = Arc :: into_inner_with_allocator ( boxed_slice ) ;
3447
3447
Ok ( unsafe { Arc :: from_inner_in ( ptr. cast ( ) , alloc) } )
3448
3448
} else {
3449
3449
Err ( boxed_slice)
0 commit comments