From 3be40b22c83491e4a4d34e2ad06aa81b804b9fad Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Sat, 12 Sep 2020 21:20:17 +0200 Subject: [PATCH] Fix AtomicPtr::from_mut align check: Avoid generic arg in const expr. See #76200. --- library/core/src/sync/atomic.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs index cdd9b3ae90b..920a82f5af4 100644 --- a/library/core/src/sync/atomic.rs +++ b/library/core/src/sync/atomic.rs @@ -858,7 +858,7 @@ impl AtomicPtr { #[inline] #[unstable(feature = "atomic_from_mut", issue = "76314")] pub fn from_mut(v: &mut *mut T) -> &Self { - let [] = [(); align_of::() - align_of::<*mut T>()]; + let [] = [(); align_of::>() - align_of::<*mut ()>()]; // SAFETY: // - the mutable reference guarantees unique ownership. // - the alignment of `*mut T` and `Self` is the same on all platforms