Re: [PATCH v2 2/3] rust: ptr: add Alignment::from_u64() for DeviceSize constants

From: John Hubbard

Date: Thu Mar 12 2026 - 02:23:37 EST


On 3/11/26 11:16 PM, Miguel Ojeda wrote:
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

Yes it does--guilty as charged, haha. :)

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.


Good catch, thanks.


thanks,
--
John Hubbard