Skip to content

Commit eeed311

Browse files
committed
Use raw version of align_of in rc data_offset
This was missed in #73845 when switching to use the raw operators. Fixes #80365
1 parent 0b644e4 commit eeed311

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/alloc/src/sync.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use core::hint;
1414
use core::intrinsics::abort;
1515
use core::iter;
1616
use core::marker::{PhantomData, Unpin, Unsize};
17-
use core::mem::{self, align_of_val, size_of_val};
17+
use core::mem::{self, align_of_val_raw, size_of_val};
1818
use core::ops::{CoerceUnsized, Deref, DispatchFromDyn, Receiver};
1919
use core::pin::Pin;
2020
use core::ptr::{self, NonNull};
@@ -2364,7 +2364,7 @@ unsafe fn data_offset<T: ?Sized>(ptr: *const T) -> isize {
23642364
// Because it is `?Sized`, it will always be the last field in memory.
23652365
// Note: This is a detail of the current implementation of the compiler,
23662366
// and is not a guaranteed language detail. Do not rely on it outside of std.
2367-
unsafe { data_offset_align(align_of_val(&*ptr)) }
2367+
unsafe { data_offset_align(align_of_val_raw(ptr)) }
23682368
}
23692369

23702370
#[inline]

0 commit comments

Comments
 (0)