On Thu Jul 9, 2026 at 5:52 PM JST, Alistair Popple wrote:
<...>
> @@ -86,15 +90,31 @@ fn probe<'bound>(
>                  // (`try_pin_init!()` initializes fields in declaration 
> order), lives at a pinned
>                  // stable address, and is dropped after `gpu` (struct field 
> drop order).
>                  gpu <- Gpu::new(pdev, unsafe { &*core::ptr::from_ref(bar) }),
> -                _reg: auxiliary::Registration::new(
> -                    pdev.as_ref(),
> -                    c"nova-drm",
> -                    // TODO[XARR]: Use XArray or perhaps IDA for proper ID 
> allocation/recycling. For
> -                    // now, use a simple atomic counter that never recycles 
> IDs.
> -                    AUXILIARY_ID_COUNTER.fetch_add(1, Relaxed),
> -                    crate::MODULE_NAME,
> -                    (),
> -                )?,
> +
> +                _reg: {
> +                    // SAFETY: `gpu` is initialized before this expression 
> is evaluated
> +                    // (`try_pin_init!()` initializes fields in declaration 
> order), lives at
> +                    // a pinned stable address, and is dropped after `_reg` 
> (struct field
> +                    // drop order).
> +                    let gpu = unsafe {
> +                        
> Pin::new_unchecked(&*core::ptr::from_ref(gpu.as_ref().get_ref()))
> +                    };

Your v1 had a 

    // TODO: Use `&gpu` self-referential pin-init syntax once available.

Can we preserve it?

Reply via email to