@@ -335,7 +335,7 @@ impl<T> Arc<T> {
335335 #[ unstable( feature = "new_uninit" , issue = "63291" ) ]
336336 pub fn new_uninit ( ) -> Arc < mem:: MaybeUninit < T > > {
337337 unsafe {
338- Arc :: from_ptr ( Arc :: allocate_for_unsized (
338+ Arc :: from_ptr ( Arc :: allocate_for_layout (
339339 Layout :: new :: < T > ( ) ,
340340 |mem| mem as * mut ArcInner < mem:: MaybeUninit < T > > ,
341341 ) )
@@ -736,11 +736,11 @@ impl<T: ?Sized> Arc<T> {
736736
737737impl < T : ?Sized > Arc < T > {
738738 /// Allocates an `ArcInner<T>` with sufficient space for
739- /// an unsized value where the value has the layout provided.
739+ /// a possibly- unsized value where the value has the layout provided.
740740 ///
741741 /// The function `mem_to_arcinner` is called with the data pointer
742742 /// and must return back a (potentially fat)-pointer for the `ArcInner<T>`.
743- unsafe fn allocate_for_unsized (
743+ unsafe fn allocate_for_layout (
744744 value_layout : Layout ,
745745 mem_to_arcinner : impl FnOnce ( * mut u8 ) -> * mut ArcInner < T >
746746 ) -> * mut ArcInner < T > {
@@ -768,7 +768,7 @@ impl<T: ?Sized> Arc<T> {
768768 /// Allocates an `ArcInner<T>` with sufficient space for an unsized value.
769769 unsafe fn allocate_for_ptr ( ptr : * const T ) -> * mut ArcInner < T > {
770770 // Allocate for the `ArcInner<T>` using the given value.
771- Self :: allocate_for_unsized (
771+ Self :: allocate_for_layout (
772772 Layout :: for_value ( & * ptr) ,
773773 |mem| set_data_ptr ( ptr as * mut T , mem) as * mut ArcInner < T > ,
774774 )
@@ -799,7 +799,7 @@ impl<T: ?Sized> Arc<T> {
799799impl < T > Arc < [ T ] > {
800800 /// Allocates an `ArcInner<[T]>` with the given length.
801801 unsafe fn allocate_for_slice ( len : usize ) -> * mut ArcInner < [ T ] > {
802- Self :: allocate_for_unsized (
802+ Self :: allocate_for_layout (
803803 Layout :: array :: < T > ( len) . unwrap ( ) ,
804804 |mem| ptr:: slice_from_raw_parts_mut ( mem as * mut T , len) as * mut ArcInner < [ T ] > ,
805805 )
0 commit comments