public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] rust: cpufreq: suppress clippy::double_parens in Policy doctest
@ 2026-03-12  4:19 John Hubbard
  2026-03-12  4:19 ` [PATCH v2 1/1] " John Hubbard
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: John Hubbard @ 2026-03-12  4:19 UTC (permalink / raw)
  To: Danilo Krummrich, Alexandre Courbot
  Cc: Joel Fernandes, Timur Tabi, Alistair Popple, Eliot Courtney,
	Shashank Sharma, Zhi Wang, David Airlie, Simona Vetter,
	Bjorn Helgaas, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, rust-for-linux, LKML, John Hubbard

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@nvidia.com

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-12 10:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-12  4:19 [PATCH v2 0/1] rust: cpufreq: suppress clippy::double_parens in Policy doctest John Hubbard
2026-03-12  4:19 ` [PATCH v2 1/1] " John Hubbard
2026-03-12  6:03 ` [PATCH v2 0/1] " Miguel Ojeda
2026-03-12  6:07   ` Viresh Kumar
2026-03-12  6:17     ` Miguel Ojeda
2026-03-12 10:11 ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox