@@ -297,7 +297,7 @@ impl<T: ?Sized + fmt::Debug> fmt::Debug for Weak<T> {
297
297
}
298
298
}
299
299
300
- struct ArcInnerMetadata {
300
+ struct ArcMetadata {
301
301
strong : atomic:: AtomicUsize ,
302
302
303
303
// the value usize::MAX acts as a sentinel for temporarily "locking" the
@@ -306,7 +306,7 @@ struct ArcInnerMetadata {
306
306
weak : atomic:: AtomicUsize ,
307
307
}
308
308
309
- impl ArcInnerMetadata {
309
+ impl ArcMetadata {
310
310
#[ inline]
311
311
fn new_strong ( ) -> Self {
312
312
Self { strong : atomic:: AtomicUsize :: new ( 1 ) , weak : atomic:: AtomicUsize :: new ( 1 ) }
@@ -323,7 +323,7 @@ impl ArcInnerMetadata {
323
323
// inner types.
324
324
#[ repr( C ) ]
325
325
struct ArcInner < T : ?Sized > {
326
- meta : ArcInnerMetadata ,
326
+ meta : ArcMetadata ,
327
327
data : T ,
328
328
}
329
329
@@ -343,7 +343,7 @@ impl<T> Arc<T> {
343
343
#[ inline]
344
344
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
345
345
pub fn new ( data : T ) -> Arc < T > {
346
- let x: Box < _ > = box ArcInner { meta : ArcInnerMetadata :: new_strong ( ) , data } ;
346
+ let x: Box < _ > = box ArcInner { meta : ArcMetadata :: new_strong ( ) , data } ;
347
347
Self :: from_inner ( Box :: leak ( x) . into ( ) )
348
348
}
349
349
@@ -373,7 +373,7 @@ impl<T> Arc<T> {
373
373
// Construct the inner in the "uninitialized" state with a single
374
374
// weak reference.
375
375
let uninit_ptr: NonNull < _ > = Box :: leak ( box ArcInner {
376
- meta : ArcInnerMetadata :: new_weak ( ) ,
376
+ meta : ArcMetadata :: new_weak ( ) ,
377
377
data : mem:: MaybeUninit :: < T > :: uninit ( ) ,
378
378
} )
379
379
. into ( ) ;
@@ -503,7 +503,7 @@ impl<T> Arc<T> {
503
503
#[ unstable( feature = "allocator_api" , issue = "32838" ) ]
504
504
#[ inline]
505
505
pub fn try_new ( data : T ) -> Result < Arc < T > , AllocError > {
506
- let x: Box < _ > = Box :: try_new ( ArcInner { meta : ArcInnerMetadata :: new_strong ( ) , data } ) ?;
506
+ let x: Box < _ > = Box :: try_new ( ArcInner { meta : ArcMetadata :: new_strong ( ) , data } ) ?;
507
507
Ok ( Self :: from_inner ( Box :: leak ( x) . into ( ) ) )
508
508
}
509
509
@@ -2521,7 +2521,7 @@ impl<T: ?Sized> AsRef<T> for Arc<T> {
2521
2521
#[ stable( feature = "pin" , since = "1.33.0" ) ]
2522
2522
impl < T : ?Sized > Unpin for Arc < T > { }
2523
2523
2524
- type ArcAllocator = PrefixAllocator < ArcInnerMetadata , Global > ;
2524
+ type ArcAllocator = PrefixAllocator < Global , ArcMetadata > ;
2525
2525
2526
2526
/// Get the offset within an `ArcInner` for the payload behind a pointer.
2527
2527
///
0 commit comments