Skip to content

Commit

Permalink
Fix AtomicPtr::from_mut align check: Avoid generic arg in const expr.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ou-se committed Sep 13, 2020
1 parent 458aaba commit 3be40b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/core/src/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ impl<T> AtomicPtr<T> {
#[inline]
#[unstable(feature = "atomic_from_mut", issue = "76314")]
pub fn from_mut(v: &mut *mut T) -> &Self {
let [] = [(); align_of::<Self>() - align_of::<*mut T>()];
let [] = [(); align_of::<AtomicPtr<()>>() - align_of::<*mut ()>()];
// SAFETY:
// - the mutable reference guarantees unique ownership.
// - the alignment of `*mut T` and `Self` is the same on all platforms
Expand Down

0 comments on commit 3be40b2

Please sign in to comment.