Re: [PATCH] rust: init: Fix generics in *_init! macros
From: Janne Grunau
Date: Sat Jun 28 2025 - 09:25:26 EST
On Sat, Jun 28, 2025 at 02:29:11PM +0200, Benno Lossin wrote:
> 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...
Nobody upstream, it's used downstream in the asahi tree.
> 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?
I don't need it since I have to carry it anyway in the downstream tree
but I think it would be good idea to fix it in v6.16.
Since it's in the kernel crate (the macros in pin-init are fine) I'd
propose that Miguel picks it with other rust fixes.
Janne