summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorDanilo Krummrich <dakr@kernel.org>2026-06-26 20:36:09 +0200
committerDanilo Krummrich <dakr@kernel.org>2026-07-11 19:42:03 +0200
commit1b56056294d45162325bb491f0356fbc6b473a12 (patch)
tree804eab854368c808a499dfbd71966e03c5353596 /tools/perf/scripts/python
parent2c91f57e81a7ece7b0b83e93462558f661055963 (diff)
rust: types: introduce ForLt base trait for CovariantForLt
Add a new ForLt trait as a base for CovariantForLt: - ForLt (non-unsafe): represents a type generic over a lifetime, with no covariance guarantee. - CovariantForLt (unsafe): becomes a subtrait of ForLt that additionally proves the type is covariant over its lifetime parameter, providing a safe cast_ref() method. This split allows non-covariant types (e.g. types behind a Mutex) to implement ForLt and participate in DevresLt / registration data patterns that use HRTB closures for sound access, without requiring a covariance proof that would fail to compile. Both macros share the UnsafeForLtImpl helper type, distinguished by a const generic N: ForLt! emits N = 0 (no covariance proof), CovariantForLt! emits N = 1 (with compile-time covariance proof). Reviewed-by: Gary Guo <gary@garyguo.net> Acked-by: Miguel Ojeda <ojeda@kernel.org> Link: https://patch.msgid.link/20260626183630.2585057-3-dakr@kernel.org [ Merge ForLt pub use, inline resolve_hrt/ty_static, add intra-doc links. - Danilo ] Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions