diff options
| author | Daniel Almeida <daniel.almeida@collabora.com> | 2025-09-19 11:12:41 +0200 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2025-10-21 12:31:56 +0200 |
| commit | 66f1ea83d9f8346324fc50779944297d778cac95 (patch) | |
| tree | b0a55e17c3d03ec9ebd0d730a9a16133ccd60652 /scripts/lib | |
| parent | 2497a7116ff9a051d0e78885a27a52213bc2841d (diff) | |
rust: lock: Add a Pin<&mut T> accessor
In order for callers to be able to access the inner T safely if T:
!Unpin, there needs to be a way to get a Pin<&mut T>. Add this accessor
and a corresponding example to tell users how it works.
This requires the pin projection functionality [1] for better ergonomic.
[boqun: Apply Daniel's fix to the code example, add the reference to pin
projection patch and remove out-of-date part in the commit log]
Suggested-by: Benno Lossin <lossin@kernel.org>
Suggested-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1181
Link: https://lore.kernel.org/rust-for-linux/20250912174148.373530-1-lossin@kernel.org/ [1]
Diffstat (limited to 'scripts/lib')
0 files changed, 0 insertions, 0 deletions
