linux/rust/macros
Thiébaud Weksteen e91836593f rust: macros: allow non-ASCII characters in authors
Module authors may have non-ASCII characters in their names. In C,
`MODULE_AUTHOR` allows arbitrary string literals which are emitted as
raw UTF-8 bytes into the `.modinfo` section, and multiple in-tree
modules use non-ASCII author names.

Originally, the single `author` field permitted arbitrary string literals
including non-ASCII characters. When support for multiple authors was
introduced in commit 38559da6af ("rust: module: introduce `authors`
key"), it reused the `expect_string_array` helper that had originally been
added for module aliases. Because that helper enforced an ASCII check,
`authors` inadvertently became restricted to ASCII-only string literals.
Later, when the macro parsing was rewritten to use `syn` in commit
c578ad703a ("rust: macros: use `syn` to parse `module!` macro"), this
restriction was carried over by using AsciiLitStr in `authors` type.

Change the element type of `authors` in `ModuleInfo` from `AsciiLitStr`
to `LitStr` so that UTF-8 author names are permitted.

Fixes: 38559da6af ("rust: module: introduce `authors` key")
Signed-off-by: Thiébaud Weksteen <tweek@google.com>
Acked-by: Petr Pavlu <petr.pavlu@suse.com>
Link: https://patch.msgid.link/20260917051147.98775-1-tweek@google.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2026-10-01 21:19:43 +02:00
..
concat_idents.rs rust: macros: convert concat_idents! to use syn 2026-01-28 00:55:25 +01:00
export.rs rust: macros: convert #[export] to use syn 2026-01-28 00:55:25 +01:00
fmt.rs Rust changes for v6.20 / v7.0 2026-02-10 11:53:01 -08:00
for_lt.rs rust: types: introduce ForLt base trait for CovariantForLt 2026-07-11 19:42:03 +02:00
helpers.rs rust: allow globally clippy::incompatible_msrv 2026-04-07 09:54:57 +02:00
kunit.rs rust: macros: simplify code using feature(extract_if) 2026-04-07 10:00:24 +02:00
lib.rs rust: macros: allow non-ASCII characters in authors 2026-10-01 21:19:43 +02:00
module.rs rust: macros: allow non-ASCII characters in authors 2026-10-01 21:19:43 +02:00
paste.rs rust: macros: use quote! from vendored crate 2026-01-28 00:55:24 +01:00
vtable.rs rust: macros: auto-insert OwnerModule in #[vtable] 2026-08-12 09:36:26 +02:00