* [PATCH] rust: debugfs: Implement BinaryReader for Mutex<T> only when T is Unpin
@ 2025-11-07 9:16 Danilo Krummrich
2025-11-07 9:37 ` Alice Ryhl
2025-11-07 21:59 ` Danilo Krummrich
0 siblings, 2 replies; 3+ messages in thread
From: Danilo Krummrich @ 2025-11-07 9:16 UTC (permalink / raw)
To: gregkh, rafael, ojeda, alex.gaynor, boqun.feng, gary, bjorn3_gh,
lossin, a.hindborg, aliceryhl, tmgross
Cc: linux-kernel, rust-for-linux, Danilo Krummrich, Stephen Rothwell
Commit da123f0ee40f ("rust: lock: guard: Add T: Unpin bound to
DerefMut") from tip/master adds an Unpin bound to T for Mutex<T>, hence
also restrict the implementation of BinaryReader for Mutex<T>
accordingly.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/all/20251107134144.117905bd@canb.auug.org.au/
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
---
rust/kernel/debugfs/traits.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/kernel/debugfs/traits.rs b/rust/kernel/debugfs/traits.rs
index 2c32ddf9826f..82441ac8adaa 100644
--- a/rust/kernel/debugfs/traits.rs
+++ b/rust/kernel/debugfs/traits.rs
@@ -257,7 +257,7 @@ fn read_from_slice(
}
// Delegate for `Mutex<T>`: Support a `T` with an outer `Mutex`.
-impl<T: BinaryReaderMut> BinaryReader for Mutex<T> {
+impl<T: BinaryReaderMut + Unpin> BinaryReader for Mutex<T> {
fn read_from_slice(
&self,
reader: &mut UserSliceReader,
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] rust: debugfs: Implement BinaryReader for Mutex<T> only when T is Unpin
2025-11-07 9:16 [PATCH] rust: debugfs: Implement BinaryReader for Mutex<T> only when T is Unpin Danilo Krummrich
@ 2025-11-07 9:37 ` Alice Ryhl
2025-11-07 21:59 ` Danilo Krummrich
1 sibling, 0 replies; 3+ messages in thread
From: Alice Ryhl @ 2025-11-07 9:37 UTC (permalink / raw)
To: Danilo Krummrich
Cc: gregkh, rafael, ojeda, alex.gaynor, boqun.feng, gary, bjorn3_gh,
lossin, a.hindborg, tmgross, linux-kernel, rust-for-linux,
Stephen Rothwell
On Fri, Nov 07, 2025 at 10:16:07AM +0100, Danilo Krummrich wrote:
> Commit da123f0ee40f ("rust: lock: guard: Add T: Unpin bound to
> DerefMut") from tip/master adds an Unpin bound to T for Mutex<T>, hence
> also restrict the implementation of BinaryReader for Mutex<T>
> accordingly.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Closes: https://lore.kernel.org/all/20251107134144.117905bd@canb.auug.org.au/
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] rust: debugfs: Implement BinaryReader for Mutex<T> only when T is Unpin
2025-11-07 9:16 [PATCH] rust: debugfs: Implement BinaryReader for Mutex<T> only when T is Unpin Danilo Krummrich
2025-11-07 9:37 ` Alice Ryhl
@ 2025-11-07 21:59 ` Danilo Krummrich
1 sibling, 0 replies; 3+ messages in thread
From: Danilo Krummrich @ 2025-11-07 21:59 UTC (permalink / raw)
To: gregkh, rafael, ojeda, alex.gaynor, boqun.feng, gary, bjorn3_gh,
lossin, a.hindborg, aliceryhl, tmgross
Cc: linux-kernel, rust-for-linux, Danilo Krummrich, Stephen Rothwell
On Fri Nov 7, 2025 at 10:16 AM CET, Danilo Krummrich wrote:
> Commit da123f0ee40f ("rust: lock: guard: Add T: Unpin bound to
> DerefMut") from tip/master adds an Unpin bound to T for Mutex<T>, hence
> also restrict the implementation of BinaryReader for Mutex<T>
> accordingly.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Closes: https://lore.kernel.org/all/20251107134144.117905bd@canb.auug.org.au/
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Applied to driver-core-next, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-07 21:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-07 9:16 [PATCH] rust: debugfs: Implement BinaryReader for Mutex<T> only when T is Unpin Danilo Krummrich
2025-11-07 9:37 ` Alice Ryhl
2025-11-07 21:59 ` Danilo Krummrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox