Re: [PATCH v9 4/9] rust: sizes: implement SizeConstants for Alignment

From: Miguel Ojeda

Date: Wed Sep 30 2026 - 05:16:53 EST


On Wed, Sep 30, 2026 at 4:44 AM Eliot Courtney <ecourtney@xxxxxxxxxx> wrote:
>
> Currently, constructing an alignment is quite verbose [1]:
>
> Alignment::new::<8>()
>
> It's unfortunate because it disincentivizes using it at interface
> boundaries. Implement `SizeConstants` for `Alignment` so we can write
> e.g. `Alignment::SZ_8` instead.

I don't find the former disincentivizing -- it is how I would expect
to have to write such a call in general. We do have the other size
constants already, and `SZ_` is well-known, so the short form is fine
too here, but I just wanted to mention that I don't think we should be
scared of seeing colons and angle brackets. :)

If this ends up going through bitmap or DRM or similar this cycle:

Acked-by: Miguel Ojeda <ojeda@xxxxxxxxxx>

Otherwise, I can pick this one up this cycle.

Thanks!

Cheers,
Miguel