@@ -26,7 +26,7 @@ use core::ops::{CoerceUnsized, Deref, DerefMut, DerefPure, DispatchFromDyn, Lega
2626use core:: ops:: { Residual , Try } ;
2727use core:: panic:: { RefUnwindSafe , UnwindSafe } ;
2828use core:: pin:: { Pin , PinCoerceUnsized } ;
29- use core:: ptr:: { self , NonNull } ;
29+ use core:: ptr:: { self , Alignment , NonNull } ;
3030#[ cfg( not( no_global_oom_handling) ) ]
3131use core:: slice:: from_raw_parts_mut;
3232use core:: sync:: atomic:: Ordering :: { Acquire , Relaxed , Release } ;
@@ -4208,11 +4208,11 @@ unsafe fn data_offset<T: ?Sized>(ptr: *const T) -> usize {
42084208 // and extern types, the input safety requirement is currently enough to
42094209 // satisfy the requirements of align_of_val_raw; this is an implementation
42104210 // detail of the language that must not be relied upon outside of std.
4211- unsafe { data_offset_align ( align_of_val_raw ( ptr) ) }
4211+ unsafe { data_offset_align ( Alignment :: new_unchecked ( align_of_val_raw ( ptr) ) ) }
42124212}
42134213
42144214#[ inline]
4215- fn data_offset_align ( align : usize ) -> usize {
4215+ fn data_offset_align ( align : Alignment ) -> usize {
42164216 let layout = Layout :: new :: < ArcInner < ( ) > > ( ) ;
42174217 layout. size ( ) + layout. padding_needed_for ( align)
42184218}
@@ -4258,7 +4258,7 @@ impl<T: ?Sized, A: Allocator> UniqueArcUninit<T, A> {
42584258
42594259 /// Returns the pointer to be written into to initialize the [`Arc`].
42604260 fn data_ptr ( & mut self ) -> * mut T {
4261- let offset = data_offset_align ( self . layout_for_value . align ( ) ) ;
4261+ let offset = data_offset_align ( self . layout_for_value . alignment ( ) ) ;
42624262 unsafe { self . ptr . as_ptr ( ) . byte_add ( offset) as * mut T }
42634263 }
42644264
0 commit comments