Re: [PATCH 09/11] rust: macros: allow arbitrary types to be used in `module!` macro

Benno Lossin
2025-12-22T06:36:52Z

On Thu Dec 11, 2025 at 7:56 PM CET, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
>
> Previously this only accepts an identifier, but now with `syn` it is
> easy to make it accepts any type.
>
> With this change, the span of types are preserved -- as a benefit, Rust
> analyzer will be able to use the "navigate to definition" feature on
> type name inside `module!` macro invocation.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>

Reviewed-by: Benno Lossin <lossin@kernel.org>

Cheers,
Benno

> ---
> rust/macros/module.rs | 29 +++++++++++++++--------------
> 1 file changed, 15 insertions(+), 14 deletions(-)