Re: [PATCH v3 3/6] rust: macros: auto-insert OwnerModule in #[vtable]
From: Gary Guo
Date: Mon Jun 22 2026 - 06:45:53 EST
On Mon Jun 22, 2026 at 3:44 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@xxxxxxxxxx>
> Suggested-by: Gary Guo <gary@xxxxxxxxxxx>
> Link: https://lore.kernel.org/all/DIMMWHUOLPSH.13JFRHDKDQJGO@xxxxxxxxxxx
> Signed-off-by: Alvin Sun <alvin.sun@xxxxxxxxx>
Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>
> ---
> rust/macros/lib.rs | 6 ++++++
> rust/macros/vtable.rs | 41 ++++++++++++++++++++++++++++++++++++-----
> 2 files changed, 42 insertions(+), 5 deletions(-)