diff options
| author | Gary Guo <gary@garyguo.net> | 2026-09-22 21:42:34 +0100 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2026-10-11 11:06:46 +0100 |
| commit | 73511e489bb0cb41d65a99b6f9df4f73a2f4827a (patch) | |
| tree | c0e7e547d19c52371656e11ad92cb594730b5407 /tools/perf/scripts/python | |
| parent | 9ad9425015e267f6fccc065980f88625d0fa6fcb (diff) | |
rust: pin-init: internal: pin_data: pin borrowed fields with wrapper
For fields that are borrowed, a mutable reference to the struct no longer
mean that it has the permission to access these fields. Therefore, the
memory that they refer to must be pinned.
Wrap these fields inside a `Borrowed` struct which pins it. They may be
accessed directly (if they're not themselves referencing other struct
fields), so implement a `Deref`.
As such fields are always pinned, there is no need to generate a
conditional `Unpin` implementations that implements `Unpin` when all fields
are. Simply generate a never satisfiable `Unpin` implementation to prevent
user from adding their own.
Acked-by: Benno Lossin <lossin@kernel.org>
Link: https://patch.msgid.link/20261008-dev-selfref-v2-4-e280b3c8fba5@garyguo.net/
Signed-off-by: Gary Guo <gary@garyguo.net>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
