diff options
| author | Danilo Krummrich <dakr@kernel.org> | 2026-06-26 20:36:10 +0200 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-07-11 19:44:38 +0200 |
| commit | 491784c54cc10dcc018059a2f2594dd336fa480b (patch) | |
| tree | 436e993232b7d284cfdb371b60ebe3a5a4d67de3 /tools/perf/scripts/python | |
| parent | 1b56056294d45162325bb491f0356fbc6b473a12 (diff) | |
rust: auxiliary: add registration_data_with() for ForLt types
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.
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Link: https://patch.msgid.link/20260626183630.2585057-4-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
