Re: [PATCH v2 0/1] rust: cpufreq: suppress clippy::double_parens in Policy doctest

From: Miguel Ojeda

Date: Thu Mar 12 2026 - 06:11:54 EST


On Thu, Mar 12, 2026 at 5:19 AM John Hubbard <jhubbard@xxxxxxxxxx> wrote:
>
> The kernel fmt! proc macro wraps each format argument as &(arg).
> Passing a tuple like (a, b) produces &((a, b)) after expansion,
> which Clippy flags as double_parens. This is a false positive,
> fixed in Clippy 1.92 (rust-lang/rust-clippy#15939), but the
> minimum toolchain (1.78) still triggers it.
>
> Add a local #[allow] with a reason attribute on the affected
> doctest function so it can be removed once the minimum toolchain
> moves past 1.92.

Applied to `rust-fixes` -- thanks everyone!

[ We may end up deciding to support per-version Clippy lints, in which
case we will need [3].

In the future, if [4] gets fixed, we may be able to use
`Delimiter::None` as Gary suggested in [5].

Link: https://lore.kernel.org/rust-for-linux/20260307170929.153892-1-ojeda@xxxxxxxxxx/
[3]
Link: https://github.com/rust-lang/rust/issues/67062 [4]
Link: https://lore.kernel.org/rust-for-linux/DGUA5GY2DGYN.3PG0FKLG7GFN1@xxxxxxxxxxx/
[5]

- Miguel ]

[ Reworded to replace GitHub-like short link with full URLs in Link tags.
Reworded reason string to match the style of a couple others we have
elsewhere. - Miguel ]

The lint doesn't trigger in stable from what I can see -- it seems to
appear with the merge of our tag that contained the `syn` rewrite
merged in 7.0, so I didn't add:

Cc: stable@xxxxxxxxxxxxxxx # Needed in 6.18.y and later

but we could if needed (e.g. if we happen to backport the `syn` rewrite).

Cheers,
Miguel