Re: [PATCH] rust: init: Fix generics in *_init! macros
From: Benno Lossin
Date: Sat Jun 28 2025 - 08:29:26 EST
On Sat Jun 28, 2025 at 1:36 PM CEST, Janne Grunau via B4 Relay wrote:
> From: Janne Grunau <j@xxxxxxxxxx>
>
> 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.
Oops, that's a good catch! Seems like nobody used the generics before...
Do you need this to go in as a fix into v6.16, or is it fine if I pick
it for v6.17, since it's only a build failure?
@Miguel any opinion?
---
Cheers,
Benno
> Fixes: 578eb8b6db13 ("rust: pin-init: move the default error behavior of `try_[pin_]init`")
> Signed-off-by: Janne Grunau <j@xxxxxxxxxx>
> ---
> rust/kernel/init.rs | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)