TBH, I think that as an attribute putting an arbitrary const expression there is kinda icky. My instinct is that if it needs to be CTFE, it'd be easier to have a (probably-magic) struct Aligned<const ALIGNMENT: ptr::Alignment, T = ()>(pub T); that you could use, either as a wrapper or just add as a ZST field.
5 Likes