* Re: Patch "rust: pin-init: internal: suppress `non_snake_case` lint in `[pin_]init!`" has been added to the 7.1-stable tree
[not found] <20260720105951.247306-1-sashal@kernel.org>
@ 2026-07-20 15:13 ` Gary Guo
2026-07-21 12:08 ` Sasha Levin
0 siblings, 1 reply; 2+ messages in thread
From: Gary Guo @ 2026-07-20 15:13 UTC (permalink / raw)
To: stable, stable-commits, adzicmirko97
Cc: Benno Lossin, Gary Guo, Miguel Ojeda, Boqun Feng,
Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
Alexandre Courbot, Onur Özkan
On Mon Jul 20, 2026 at 11:59 AM BST, Sasha Levin wrote:
> This is a note to let you know that I've just added the patch titled
>
> rust: pin-init: internal: suppress `non_snake_case` lint in `[pin_]init!`
>
> to the 7.1-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
>
> The filename of the patch is:
> rust-pin-init-internal-suppress-non_snake_case-lint-.patch
> and it can be found in the queue-7.1 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@vger.kernel.org> know about it.
Hi Sasha,
Looks like quite a lot of patches have been picked up as dependency in order to
pick this to 7.1.
The warning that this fix addresses are already worked around on the user side,
so it probably isn't worth backporting.
Best,
Gary
>
>
>
> commit 54db70c2ed9fb176f2f097a04c55b67071dc0db7
> Author: Mirko Adzic <adzicmirko97@gmail.com>
> Date: Wed May 27 18:19:54 2026 +0100
>
> rust: pin-init: internal: suppress `non_snake_case` lint in `[pin_]init!`
>
> [ Upstream commit 5423ef9d4db852835746001d0840231227bb0e39 ]
>
> Allows `non_snake_case` lint on local variables generated in `[pin_]init!`.
>
> Conceptually the identifiers in `[pin_]init!` just references the field
> names, and are not defining them, so the warning should not be generated,
> similar to how constructing a struct with non-snake-case field names do no
> generate these warnings.
>
> Reported-by: Gary Guo <gary@garyguo.net>
> Closes: https://github.com/Rust-for-Linux/pin-init/issues/125
> Closes: https://lore.kernel.org/rust-for-linux/DGTBJBIVFZ2K.2F1ZEFGY0G7NK@garyguo.net/
> Fixes: 42415d163e5d ("rust: pin-init: add references to previously initialized fields")
> Signed-off-by: Mirko Adzic <adzicmirko97@gmail.com>
> [ Reworded commit message - Gary ]
> Link: https://patch.msgid.link/20260527-pin-init-sync-v1-3-e20335ed2501@garyguo.net
> Signed-off-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
>
> diff --git a/rust/pin-init/internal/src/init.rs b/rust/pin-init/internal/src/init.rs
> index aba32825fef477..45528ab82f6a82 100644
> --- a/rust/pin-init/internal/src/init.rs
> +++ b/rust/pin-init/internal/src/init.rs
> @@ -307,7 +307,9 @@ fn init_fields(
> #init
>
> #(#cfgs)*
> - #[allow(unused_variables)]
> + // Allow `non_snake_case` since the same warning is going to be reported for the struct
> + // field.
> + #[allow(unused_variables, non_snake_case)]
> let #ident = #guard.let_binding();
> });
>
^ permalink raw reply [flat|nested] 2+ messages in thread