Re: [PATCH v7 05/10] rust: io: add IoLoc and IoWrite types
From: Alexandre Courbot
Date: Fri Mar 06 2026 - 09:53:17 EST
On Fri Mar 6, 2026 at 11:32 PM JST, Alexandre Courbot wrote:
<snip>
>> `MyRegArray` here is a type name that is a bitfield and not an array. `foo` returns a
>> single value and not an array. "at" here is saying that the register is at a
>> specific location and doesn't really indicate the array nature.
>>
>> This is why I insist that I would prefer an explicit location
>>
>> bar.write(REG_ARRAY.at(10), Reg::foo())
>>
>> would have no ambiguity whatsoever about user's intent.
>
> IIUC `REG_ARRAY` would be a const ZST and `at` a method returning an
> `AtArray(usize)`? I still have doubts that its generic type could be
> inferred automatically but it's worth giving it a go.
I don't know why I assumed that `AtArray` had a generic - it has none of
course. So there is no problem building it in this context.