Re: [PATCH v4 03/20] rust: io: restrict untyped IO access and `register!` to `Region`

From: Gary Guo

Date: Mon Jun 15 2026 - 06:22:59 EST


On Mon Jun 15, 2026 at 6:17 AM BST, Alexandre Courbot wrote:
> On Fri Jun 12, 2026 at 1:28 AM JST, Gary Guo wrote:
>> -impl<T, B> IoLoc<T> for RelativeRegisterLoc<T, B>
>> +// FIXME: Make use of `Base` type parameter of `Region` directly.
>
> `Region` does not have any `Base` type parameter, so I am not sure what
> this refers to.

Hmm, this is indeed awkwardly worded. I think I want to say

Make use of `Base` type parameter instead of using `Region` directly.

The idea is that with `IoLoc<Base, T>`, we can have

#[repr(transparent)]
struct Subregion(Region<SUBREGION_SIZE>);

and have `RelativeRegisterLoc` just become `impl IoLoc<Subregion, T>`.
`Subregion` then itself can be a `impl IoLoc<Region, Subregion>` and we can use
projection to get the view of the subregion.

Anyhow, that is all further possibilities, and I'll just remove this line in the
next version.

Best,
Gary

>
> Is this to make relative registers tied to a specific register block
> type? If so, it would help to expand this FIXME a bit as it might be
> difficult to understand without context.