about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2020-12-28 19:09:24 +0000
committerGitHub <noreply@github.com>2020-12-28 19:09:24 +0000
commit7003537df681fe150b4bfaa8cd02011ac1614370 (patch)
tree8cba5eddddf298f52209e22d5e38ec848bc121db
parentbae6475443ff7ebc54e438cfa827ce7107a8b2c1 (diff)
parenteeed3118d0a10807503346406004aa3e01ae7755 (diff)
downloadrust-7003537df681fe150b4bfaa8cd02011ac1614370.tar.gz
rust-7003537df681fe150b4bfaa8cd02011ac1614370.zip
Rollup merge of #80398 - CAD97:fix-80365, r=dtolnay
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.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs
index 53ba9c283ae..7c03345aba5 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};
@@ -2366,7 +2366,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]