]> git.ipfire.org Git - thirdparty/linux.git/commit
rust: init: Fix generics in *_init! macros
authorJanne Grunau <j@jannau.net>
Sat, 28 Jun 2025 11:36:00 +0000 (13:36 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 29 Jun 2025 16:30:45 +0000 (18:30 +0200)
commitfe49aae0fcb348b656bbde2eb1d1c75d8a1a5c3c
tree17da5f6e957c874ba48ac1f2f6d3a8b56934b4c8
parent86731a2a651e58953fc949573895f2fa6d456841
rust: init: Fix generics in *_init! macros

The match pattern for a optional trailing comma in the list of generics
is erroneously repeated in the code block resulting in following error:

| error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
|    --> rust/kernel/init.rs:301:73
|     |
| 301 |         ::pin_init::try_pin_init!($(&$this in)? $t $(::<$($generics),* $(,)?>)? {
|     |                                                                         ^^^

Remove "$(,)?" from all code blocks in the try_init! and try_pin_init!
definitions.

Cc: stable@vger.kernel.org
Fixes: 578eb8b6db13 ("rust: pin-init: move the default error behavior of `try_[pin_]init`")
Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Link: https://lore.kernel.org/r/20250628-rust_init_trailing_comma-v1-1-2d162ae1a757@jannau.net
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/init.rs