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

From: John Hubbard

Date: Thu Mar 12 2026 - 00:19:56 EST


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.

Changes in v2:
* Drop the v1 approach of splitting format arguments.

* Drop the rustdoc_test_gen.rs blanket suppress (was posted
inline during discussion, never sent as a formal patch).

* Instead, add a local #[allow(clippy::double_parens)] with a
reason attribute on the specific doctest, per Gary and Miguel's
suggestions.

v1 is here:
https://lore.kernel.org/20260304195330.185829-1-jhubbard@xxxxxxxxxx

John Hubbard (1):
rust: cpufreq: suppress clippy::double_parens in Policy doctest

rust/kernel/cpufreq.rs | 1 +
1 file changed, 1 insertion(+)


base-commit: 80234b5ab240f52fa45d201e899e207b9265ef91
--
2.53.0