Thread (19 messages) 19 messages, 3 authors, 5d ago

Re: [PATCH v4 4/9] rust: macros: auto-insert OwnerModule in #[vtable]

From: "Gary Guo" <gary@garyguo.net>
Date: 2026-06-23 13:50:54
Also in: dri-devel, driver-core, linux-block, linux-kselftest, linux-pci, lkml, netdev, nova-gpu, rust-for-linux

On Tue Jun 23, 2026 at 7:29 AM BST, Alvin Sun wrote:
Auto-add `type OwnerModule: ::kernel::ModuleMetadata;` as a required
associated type on the trait side if not already defined, and
auto-insert `type OwnerModule = crate::LocalModule;` on the impl side
if not explicitly provided, eliminating the need to manually declare
and implement `OwnerModule` in every vtable trait and impl.

Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Suggested-by: Gary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/all/DIMMWHUOLPSH.13JFRHDKDQJGO@garyguo.net (local)
Signed-off-by: Alvin Sun <redacted>
Reviewed-by: Gary Guo <gary@garyguo.net>
---
 rust/macros/lib.rs    |  6 ++++++
 rust/macros/vtable.rs | 41 ++++++++++++++++++++++++++++++++++++-----
 2 files changed, 42 insertions(+), 5 deletions(-)
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help