lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251110133843.37ff0749@eugeo>
Date: Mon, 10 Nov 2025 13:38:43 +0000
From: Gary Guo <gary@...yguo.net>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, Greg Kroah-Hartman
 <gregkh@...uxfoundation.org>, "Rafael J. Wysocki" <rafael@...nel.org>,
 Danilo Krummrich <dakr@...nel.org>, Brendan Higgins
 <brendan.higgins@...ux.dev>, David Gow <davidgow@...gle.com>, Alex Gaynor
 <alex.gaynor@...il.com>, Rae Moar <raemoar63@...il.com>,
 linux-kselftest@...r.kernel.org, kunit-dev@...glegroups.com, Boqun Feng
 <boqun.feng@...il.com>, "Björn Roy Baron"
 <bjorn3_gh@...tonmail.com>, Benno Lossin <lossin@...nel.org>, Andreas
 Hindborg <a.hindborg@...nel.org>, Trevor Gross <tmgross@...ch.edu>,
 rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
 patches@...ts.linux.dev
Subject: Re: [PATCH 1/2] rust: allow `unreachable_pub` for doctests

On Mon, 10 Nov 2025 11:53:16 +0000
Alice Ryhl <aliceryhl@...gle.com> wrote:

> On Mon, Nov 10, 2025 at 12:35:27PM +0100, Miguel Ojeda wrote:
> > Examples (i.e. doctests) may want to show public items such as structs,
> > thus the `unreachable_pub` warning is not very helpful.
> > 
> > Thus allow it for all doctests.
> > 
> > In addition, remove it from the existing `expect`s we have in a couple
> > doctests.
> > 
> > Suggested-by: Alice Ryhl <aliceryhl@...gle.com>
> > Link: https://lore.kernel.org/rust-for-linux/aRG9VjsaCjsvAwUn@google.com/
> > Signed-off-by: Miguel Ojeda <ojeda@...nel.org>  
> 
> Reviewed-by: Alice Ryhl <aliceryhl@...gle.com>
> 
> >  rust/kernel/init.rs         | 2 +-
> >  rust/kernel/types.rs        | 2 +-
> >  scripts/rustdoc_test_gen.rs | 1 +
> >  3 files changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs
> > index 4949047af8d7..e476d81c1a27 100644
> > --- a/rust/kernel/init.rs
> > +++ b/rust/kernel/init.rs
> > @@ -67,7 +67,7 @@
> >  //! ```
> >  //!
> >  //! ```rust
> > -//! # #![expect(unreachable_pub, clippy::disallowed_names)]
> > +//! # #![expect(clippy::disallowed_names)]  
> 
> Maybe we should also allow disallowed_names in doc tests?
> 
> Alice

+1 on allowing disallowed_names. I think for doc tests we should try
to reduce false positives to make it easier to write them. We shouldn't
try to enable all clippy lints on doc tests, especially that clippy
doesn't run today on rustdocs at all.

Best,
Gary

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ