Re: [PATCH v2 05/11] rust: io: restrict untyped IO access and `register!` to `Region`
From: Andreas Hindborg
Date: Wed Apr 29 2026 - 04:05:46 EST
"Danilo Krummrich" <dakr@xxxxxxxxxx> writes:
> On Tue Apr 28, 2026 at 4:41 PM CEST, Andreas Hindborg wrote:
>> That is probably a good call 😅 Going over the pieces again, I am not
>> sure when and where I decided this was an index rather than a byte
>> offset.
>
> This is not the first time I see someone stumble over this, assuming this has
> index semantics, i.e. I assume there might be something creating this
> impression.
>
> However, I can't see what that might be (probably I'm too used to the C
> primitives). In case you know, I'd be interesting for me to know.
Not sure, I think I just conflated things from `CoherentAllocation`
where we used to have `item_from_index`. Once the mind is in that frame
of understanding, it is easy to read `ptr.wrapping_byte_add` as
`ptr.wrapping_add`.
Best regards,
Andreas Hindborg