diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2020-09-12 21:20:17 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2020-09-13 14:09:10 +0200 |
| commit | 3be40b22c83491e4a4d34e2ad06aa81b804b9fad (patch) | |
| tree | 5eafb0d1e29963034392f7aedceaf4bb4349ed3a | |
| parent | 458aaba08467dc6b8d04b79f955a46be779d94f1 (diff) | |
| download | rust-3be40b22c83491e4a4d34e2ad06aa81b804b9fad.tar.gz rust-3be40b22c83491e4a4d34e2ad06aa81b804b9fad.zip | |
Fix AtomicPtr::from_mut align check: Avoid generic arg in const expr.
See #76200.
| -rw-r--r-- | library/core/src/sync/atomic.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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<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 |
