# \#\[repr(align(…))\] should allow any constant expression, not just integer literals

**URL:** <https://internals.rust-lang.org/t/repr-align-should-allow-any-constant-expression-not-just-integer-literals/23917>\
**Category:** Uncategorized\
**Created:** [January 13, 2026, 1:58am UTC](https://internals.rust-lang.org/t/repr-align-should-allow-any-constant-expression-not-just-integer-literals/23917 "2026-01-13T01:58:39Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![scottmcm](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/scottmcm/32/2355_2.png) [@scottmcm](https://internals.rust-lang.org/u/scottmcm)\
**Post date:** [January 13, 2026, 8:31am UTC](https://internals.rust-lang.org/t/repr-align-should-allow-any-constant-expression-not-just-integer-literals/23917/4 "2026-01-13T08:31:59Z")

</div>

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.

---

_[View the full topic](https://internals.rust-lang.org/t/repr-align-should-allow-any-constant-expression-not-just-integer-literals/23917)._
