Re: [PATCH DNM 2/2] interconnect: Add a test Rust consumer driver

From: Konrad Dybcio

Date: Fri Dec 19 2025 - 07:57:37 EST


On 7/23/25 3:22 PM, Benno Lossin wrote:
> On Wed Jul 23, 2025 at 3:10 PM CEST, Daniel Almeida wrote:
>> On 22 Jul 2025, at 18:14, Konrad Dybcio <konradybcio@xxxxxxxxxx> wrote:
>>> +#[pin_data]
>>> +struct IccTestConsumerDriver {
>>> + #[pin]
>>> + path: IccPath,
>>> +}
>>
>> I don’t think this does anything useful without PhantomPinned, but Benno is
>> the right person to chime in here.
>
> It does do something useful, there just has to be one type marked with
> `#[pin]` that is `!Unpin` (so for example `PhantomPinned`, `Opaque<T>`
> etc.).
>
> In this case however, `IccPath` is a newtype of `*mut bindings::icc_path`
> which isn't `PhantomPinned`, so this doesn't ensure that the
> `IccTestConsumerDriver` will stay pinned after initializing.
>
>> More importantly though, why do you have #[pin] on IccPath?
>
> Another question is: why is `IccPath` not a newtype of
> `Opaque<bindings::icc_path>`? And then one can use `&IccPath`.

The short answer to all of your questions happens to be the simple
"the code compiled".. :) I didn't know about Opaque<T>, thanks

Konrad