Re: [PATCH v4 0/4] rust: add Bounded integer type

From: Alexandre Courbot

Date: Tue Nov 11 2025 - 03:18:17 EST


On Sat Nov 8, 2025 at 11:23 AM JST, Alexandre Courbot wrote:
> Minor revision adding the feedback received on v3.
>
> Patch 3 adds a MAINTAINERS entry in case the Rust core team would like
> us to maintain this, but please ignore it if you prefer to take it under
> the core umbrella.
>
> This series provides `Bounded`, a wrapper type for primitive integers
> that guarantees that only a given number of bits are used to represent
> values. This is particularly useful when working with bitfields, as the
> guarantee that a given value fits within the number of assigned bits can
> be enforced by the type system, saving cumbersome runtime checks, or
> (worse) stripping data when bits are silently dropped.
>
> For a basic usage, please see the rustdoc of the `Bounded` type on the
> second patch.
>
> The first use of this will be to represent bitfields in Nova register
> types to guarantee that no data is ever stripped when manipulating them.
> This should eventually allow the `bitfield` and `register` macros to
> move out of Nova and into the kernel crate.
>
> The last patch is just here to illustrate the use of this module; it is
> not intended to be merged this cycle as it would likely result in big
> merge conflicts with the drm tree.
>
> This series applies on top of drm-rust-next for the needs of the last
> patch, but the first 2 patches should apply cleanly on rust-next. A
> branch with this series and its dependencies is available here:
>
> https://github.com/Gnurou/linux/tree/b4/bounded_ints
>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>

Hi Rust core team,

With -rc6 approaching, may I enquire on the appetite to merge this for
6.19? This is the last hard dependency for moving the bitfield/register
macros out of Nova, so we need it if we want to tackle this for the next
cycle.

Please let me know if there is more I can do to bring this to shape! :)