Re: [PATCH v2 1/2] rust: add BitInt integer wrapping type

Alice Ryhl
2025-11-03T10:49:27Z

On Mon, Nov 03, 2025 at 10:17:48AM +0000, Alice Ryhl wrote:
> On Sun, Nov 02, 2025 at 11:24:42PM +0900, Alexandre Courbot wrote:
> > Add the `BitInt` type, which is an integer on which the number of bits
> > allowed to be used is restricted, capping its maximal value below that
> > of primitive type is wraps.
> >
> > This is useful to e.g. enforce guarantees when working with bit fields.
> >
> > Alongside this type, provide many `From` and `TryFrom` implementations
> > are to reduce friction when using with regular integer types. Proxy
> > implementations of common integer traits are also provided.
> >
> > Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
>
> Reviewed-by: Alice Ryhl <aliceryhl@google.com>

Actually, I saw Yury's comments on v1 and I have some additional comments
as well. See my reply there.

Alice