Contradiction in documentation about alignment of AtomicBool #126084
Closed
Description
Location
https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicBool.html
Summary
The introductory section for AtomicBool
states:
This type has the same size, alignment, and bit validity as a bool.
But later the safety requirements for from_ptr
state:
ptr
must be aligned toalign_of::<AtomicBool>()
(note that on some platforms this can be bigger thanalign_of::<bool>()
).
This seems to be a contradiction. If AtomicBool has the same alignment as bool
then how can align_of::<AtomicBool>()
be bigger than align_of::<bool>()
.