Re: [PATCH v7 16/31] rust: ptr: add const_align_up()

From: Alice Ryhl

Date: Fri Mar 20 2026 - 09:31:17 EST


On Fri, Mar 20, 2026 at 2:16 PM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> On Fri, Mar 20, 2026 at 2:15 PM David Rheinsberg <david@xxxxxxxxxxxx> wrote:
> >
> > Oh yeah, it is definitely worse, but I think on an acceptable level. I would argue the cmove is a non-issue, because it is a reg<->reg move, but... meh, not sure I wanna dig deeper.
>
> If this is mostly meant to be used in `const` contexts like in this
> patch series, then the assembly doesn't matter much to begin with.

We took away all the elements that make it suitable for const only
(panics), so I did make this suggestion:
https://lore.kernel.org/all/CAH5fLgjbZZaxRaAvodUM4xkKY4YOz=n-hcWG-JraLi_Acu7u8g@xxxxxxxxxxxxxx/

> In any case, the goal is to eventually use the `core` type, yeah, i.e.
> we have `ptr_alignment_type` in our wishlist.
>
> Cheers,
> Miguel