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

From: Alexandre Courbot
Date: Mon Nov 03 2025 - 08:42:53 EST


On Mon Nov 3, 2025 at 7:49 PM JST, Alice Ryhl wrote:
> 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@xxxxxxxxxx>
>>
>> Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
>
> Actually, I saw Yury's comments on v1 and I have some additional comments
> as well. See my reply there.

Gotcha - ignoring your Reviewed-by tag for now.