]> Gentwo Git Trees - linux/.git/commit
rust: debugfs: Implement Reader for Mutex<T> only when T is Unpin
authorBoqun Feng <boqun.feng@gmail.com>
Wed, 22 Oct 2025 03:42:37 +0000 (23:42 -0400)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 22 Oct 2025 13:21:51 +0000 (15:21 +0200)
commit37d0472c8ac441af8bc10fc4959ad9d62dd5fa4c
tree926feb9ceedafb7e81f2ead64111bf6ba5a023a0
parent795aab353d0650b2d04dc3aa2e22a51000cb2aaa
rust: debugfs: Implement Reader for Mutex<T> only when T is Unpin

Since we are going to make `Mutex<T>` structurally pin the data (i.e.
`T`), therefore `.lock()` function only returns a `Guard` that can
dereference a mutable reference to `T` if only `T` is `Unpin`, therefore
restrict the impl `Reader` block of `Mutex<T>` to that.

Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patch.msgid.link/20251022034237.70431-1-boqun.feng@gmail.com
rust/kernel/debugfs/traits.rs