Skip to content

Commit 3be40b2

Browse files
committed
Fix AtomicPtr::from_mut align check: Avoid generic arg in const expr.
See #76200.
1 parent 458aaba commit 3be40b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/sync/atomic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ impl<T> AtomicPtr<T> {
858858
#[inline]
859859
#[unstable(feature = "atomic_from_mut", issue = "76314")]
860860
pub fn from_mut(v: &mut *mut T) -> &Self {
861-
let [] = [(); align_of::<Self>() - align_of::<*mut T>()];
861+
let [] = [(); align_of::<AtomicPtr<()>>() - align_of::<*mut ()>()];
862862
// SAFETY:
863863
// - the mutable reference guarantees unique ownership.
864864
// - the alignment of `*mut T` and `Self` is the same on all platforms

0 commit comments

Comments
 (0)