Re: [PATCH 04/11] rust: macros: use `syn` to parse `module!` macro

Gary Guo
2026-01-05T02:20:33Z

On Sun, 4 Jan 2026 17:53:04 -0500
Tamir Duberstein <tamird@gmail.com> wrote:

> On Thu, Dec 11, 2025 at 2:29 PM Gary Guo <gary@kernel.org> wrote:
> >
> > From: Gary Guo <gary@garyguo.net>
> >
> > +enum ModInfoField {
> > + Type(Token![type], Token![:], Ident),
> > + Name(kw::name, Token![:], AsciiLitStr),
> > + Authors(
> > + kw::authors,
> > + Token![:],
> > + Bracket,
> > + Punctuated<LitStr, Token![,]>,
> > + ),
>
> Per the documentation on macros::module, authors must be ASCII.

Ah, I am mislead by the helper name, thinking that the current impl
supports Unicode. To be fair, author names should support unicode (we
previously use ASCII mostly because we don't want to do many parsing
and escaping).

However I'll leave it to a future patch and keep things ASCII for this
series in the new version.

>
> > + Description(kw::description, Token![:], LitStr),
> > + License(kw::license, Token![:], AsciiLitStr),
> > + Alias(
> > + kw::authors,
>
> This should be kw::alias

Good catch.

Best,
Gary

>
> > + Token![:],
> > + Bracket,
> > + Punctuated<LitStr, Token![,]>,
> > + ),
>
> Per the documentation on macros::module, alias must be ASCII.
>
> > + Firmware(
> > + kw::firmware,
> > + Token![:],
> > + Bracket,
> > + Punctuated<LitStr, Token![,]>,
> > + ),
>
> Must be ASCII.
>