Description
This intrinsic returns the "preferred" alignment of a type, which can be different from the minimal alignment exposed via mem::align_of
. It is not currently exposed through any wrapper method, but can still be accessed by unstable code using the intrinsics
or core_intrinsics
features.
See #90877 for why it cannot be removed; the short summary is some code is actually using it. So let's have a place to centralize discussion about the intrinsics. (This is not a regular tracking issue because there is no associated feature gate, but close enough I think.)
It would be good to figure out what the "preferred alignment" actually is used for, e.g. there doesn't seem to be consensus on the question whether it is ever relevant for ABI or UB, or whether it is merely a hint used by the compiler to align some globals more than it has to.