On Sun May 17, 2026 at 9:00 AM JST, Danilo Krummrich wrote: > Add a 'bound lifetime to the associated Data, changing type Data to type > Data<'bound>. > > This allows the driver's bus device private data to capture the device / > driver bound lifetime; device resources can be stored directly by > reference rather than requiring Devres. > > The probe() and unbind() callbacks thus gain a 'bound lifetime parameter > on the methods themselves; avoiding a global lifetime on the trait impl. > > Existing drivers set type Data<'bound> = Self, preserving the current > behavior. > > Signed-off-by: Danilo Krummrich <[email protected]> > ---
Is this really sound without a covariance proof? For example, with this version you could stash a Cell<Option<&'bound pci::Device<Bound>> (even with Gary's suggested Core<'_> change) and then observe that reference on Drop of Data, which seems unsound to me.
