Re: [PATCH v6] rust: kernel: add support for bits/genmask macros
From: Daniel Almeida
Date: Fri Jun 20 2025 - 09:49:46 EST
Hi Joel,
>
>>>>>
>>>>
>>>> I think generic over `RangeBounds` is a good idea, and we should
>>>> .is_emtpy() or .contains() instead of comparison + boolean operation
>>>> when possible. Seems we need a function to check whether one range
>
> I am also of the opinion that RangeBounds is a good idea. I think it may come
> down to both classes of devs, those who have used genmask before in C and
> expect inclusivity, and those who are using it for the first time in Rust -
> the latter may almost always want to use the non-inclusive syntax, no?
>
> thanks,
>
> - Joel
Can’t do that in a const fn, and we really want a const fn as the default.
Hence my suggestion to only support a..=b, which is both correct and explicit.
— Daniel