diff options
| author | CAD97 <cad97@cad97.com> | 2020-12-26 18:16:44 -0500 |
|---|---|---|
| committer | CAD97 <cad97@cad97.com> | 2020-12-26 18:37:07 -0500 |
| commit | eeed3118d0a10807503346406004aa3e01ae7755 (patch) | |
| tree | 53e018bdbd7fa0a45ba5bd566b7c79142d062161 | |
| parent | 0b644e419681835bd0f5871c3bfbd648aa04f157 (diff) | |
| download | rust-eeed3118d0a10807503346406004aa3e01ae7755.tar.gz rust-eeed3118d0a10807503346406004aa3e01ae7755.zip | |
Use raw version of align_of in rc data_offset
This was missed in #73845 when switching to use the raw operators. Fixes #80365
| -rw-r--r-- | library/alloc/src/sync.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 9d478a302e9..38db47cdafb 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -14,7 +14,7 @@ use core::hint; use core::intrinsics::abort; use core::iter; use core::marker::{PhantomData, Unpin, Unsize}; -use core::mem::{self, align_of_val, size_of_val}; +use core::mem::{self, align_of_val_raw, size_of_val}; use core::ops::{CoerceUnsized, Deref, DispatchFromDyn, Receiver}; use core::pin::Pin; use core::ptr::{self, NonNull}; @@ -2364,7 +2364,7 @@ unsafe fn data_offset<T: ?Sized>(ptr: *const T) -> isize { // Because it is `?Sized`, it will always be the last field in memory. // Note: This is a detail of the current implementation of the compiler, // and is not a guaranteed language detail. Do not rely on it outside of std. - unsafe { data_offset_align(align_of_val(&*ptr)) } + unsafe { data_offset_align(align_of_val_raw(ptr)) } } #[inline] |
