On Fri Jun 19, 2026 at 12:08 AM BST, Danilo Krummrich wrote: > Add registration_data_with() taking a for<'a> closure that receives > Pin<&'a F::Of<'a>>, which works with any ForLt type. Taking a for<'a> > closure rather than returning a direct reference prevents callers from > choosing a concrete lifetime for the data, which is required for > soundness with non-covariant ForLt types. > > Extract the common null-check, TypeId-check and KBox-borrow logic into a > private registration_data_pinned() helper shared by both > registration_data_with() and the existing registration_data(). > > Relax Registration's bound from CovariantForLt to ForLt so that > non-covariant types can be registered. > > Signed-off-by: Danilo Krummrich <[email protected]>
Reviewed-by: Gary Guo <[email protected]> > --- > rust/kernel/auxiliary.rs | 91 ++++++++++++++++++++++++++++------------ > 1 file changed, 65 insertions(+), 26 deletions(-)
