Re: [PATCH v2 2/3] rust: ptr: add Alignment::from_u64() for DeviceSize constants
From: Miguel Ojeda
Date: Thu Mar 12 2026 - 02:18:47 EST
On Thu, Mar 12, 2026 at 4:15 AM John Hubbard <jhubbard@xxxxxxxxxx> wrote:
>
> + /// A build error is triggered if `align` is not a power of two, or if it
> + /// exceeds [`usize::MAX`].
I think this wording comes from the `new` constructor, but there we
use a const assert, not a runtime one.
So as you mention in the commit message, it is true that if you call
it in a const context you will get it at compile-time error, but the
wording here in the docs seems to imply otherwise.
Cheers,
Miguel