On Mon Sep 28, 2026 at 2:10 PM CEST, Gary Guo wrote:
> On Mon Sep 28, 2026 at 1:00 PM BST, Danilo Krummrich wrote:
>> On Mon Sep 28, 2026 at 1:36 PM CEST, Gary Guo wrote:
>>> I think this doesn't need to use `pin_chain`? You can do
>>>
>>>     gpu <- ...,
>>>
>>>     _: {
>>>         #[cfg(...)]
>>>         gpu.run_self_tests(pdev);
>>>     }
>>
>> Unfortunately, this produces the following error.
>>
>>      error[E0382]: borrow of moved value: `gpu`
>>         --> drivers/gpu/nova-core/driver.rs:140:62
>>          |
>>      119 |             gpu <- Gpu::new(
>>          |             --- move occurs because `gpu` has type 
>> `core::pin::Pin<&mut gpu::Gpu<'_>>`, which does not implement the `Copy` 
>> trait
>>      ...
>>      129 |                 gpu.run_selftests(pdev);
>>          |                 --- value moved here
>
>     gpu.as_mut().run_selftests(pdev);
>
> should work?

I tried that previously, that gives another error. I didn't dig in further
though.

        error[E0596]: cannot borrow `gpu` as mutable, as it is not declared as 
mutable
           --> drivers/gpu/nova-core/driver.rs:129:17
            |
        129 |                 gpu.as_mut().run_selftests(pdev);
            |                 ^^^ cannot borrow as mutable
            |
        help: consider changing this to be mutable
            |
        119 |             mut gpu <- Gpu::new(
            |             +++
        
        error: aborting due to 1 previous error

Reply via email to