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

From: Benno Lossin

Date: Mon Dec 22 2025 - 01:36:52 EST


On Thu Dec 11, 2025 at 7:56 PM CET, Gary Guo wrote:
> From: Gary Guo <gary@xxxxxxxxxxx>
>
> 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@xxxxxxxxxxx>

Reviewed-by: Benno Lossin <lossin@xxxxxxxxxx>

Cheers,
Benno

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