mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 15:03:53 +02:00
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: 578eb8b6db
("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>
This commit is contained in:
parent
86731a2a65
commit
fe49aae0fc
|
@ -231,14 +231,14 @@ macro_rules! try_init {
|
|||
($(&$this:ident in)? $t:ident $(::<$($generics:ty),* $(,)?>)? {
|
||||
$($fields:tt)*
|
||||
}) => {
|
||||
::pin_init::try_init!($(&$this in)? $t $(::<$($generics),* $(,)?>)? {
|
||||
::pin_init::try_init!($(&$this in)? $t $(::<$($generics),*>)? {
|
||||
$($fields)*
|
||||
}? $crate::error::Error)
|
||||
};
|
||||
($(&$this:ident in)? $t:ident $(::<$($generics:ty),* $(,)?>)? {
|
||||
$($fields:tt)*
|
||||
}? $err:ty) => {
|
||||
::pin_init::try_init!($(&$this in)? $t $(::<$($generics),* $(,)?>)? {
|
||||
::pin_init::try_init!($(&$this in)? $t $(::<$($generics),*>)? {
|
||||
$($fields)*
|
||||
}? $err)
|
||||
};
|
||||
|
@ -291,14 +291,14 @@ macro_rules! try_pin_init {
|
|||
($(&$this:ident in)? $t:ident $(::<$($generics:ty),* $(,)?>)? {
|
||||
$($fields:tt)*
|
||||
}) => {
|
||||
::pin_init::try_pin_init!($(&$this in)? $t $(::<$($generics),* $(,)?>)? {
|
||||
::pin_init::try_pin_init!($(&$this in)? $t $(::<$($generics),*>)? {
|
||||
$($fields)*
|
||||
}? $crate::error::Error)
|
||||
};
|
||||
($(&$this:ident in)? $t:ident $(::<$($generics:ty),* $(,)?>)? {
|
||||
$($fields:tt)*
|
||||
}? $err:ty) => {
|
||||
::pin_init::try_pin_init!($(&$this in)? $t $(::<$($generics),* $(,)?>)? {
|
||||
::pin_init::try_pin_init!($(&$this in)? $t $(::<$($generics),*>)? {
|
||||
$($fields)*
|
||||
}? $err)
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user