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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251119185125.1411151-1-ojeda@kernel.org>
Date: Wed, 19 Nov 2025 19:51:25 +0100
From: Miguel Ojeda <ojeda@...nel.org>
To: Alexandre Courbot <acourbot@...dia.com>,
	Danilo Krummrich <dakr@...nel.org>,
	Alice Ryhl <aliceryhl@...gle.com>,
	Miguel Ojeda <ojeda@...nel.org>,
	Alex Gaynor <alex.gaynor@...il.com>
Cc: Boqun Feng <boqun.feng@...il.com>,
	Gary Guo <gary@...yguo.net>,
	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: [PATCH] rust: slice: fix broken intra-doc links

In older versions of Rust, the compiler doesn't know about the newer
`as_flattened*` methods, thus `rustdoc` complains about the intra-doc
links, e.g.

     error: unresolved link to `slice::as_flattened`
      --> rust/kernel/slice.rs:19:23
       |
    19 | /// [`as_flattened`]: slice::as_flattened
       |                       ^^^^^^^^^^^^^^^^^^^ the primitive type `slice` has no associated item named `as_flattened`
       |
       = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
       = help: to override `-D warnings` add `#[allow(rustdoc::broken_intra_doc_links)]`

Thus fix them by using an URL instead.

Fixes: 88622323dde3 ("rust: enable slice_flatten feature and provide it through an extension trait")
Signed-off-by: Miguel Ojeda <ojeda@...nel.org>
---
I have seen this in -next -- please feel free to take it or rebase if
preferred etc., of course. Thanks!

 rust/kernel/slice.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/rust/kernel/slice.rs b/rust/kernel/slice.rs
index 6ca91a4fd1f2..ca2cde135061 100644
--- a/rust/kernel/slice.rs
+++ b/rust/kernel/slice.rs
@@ -16,22 +16,22 @@
 ///
 /// This trait can be removed once the MSRV passes 1.80.
 ///
-/// [`as_flattened`]: slice::as_flattened
-/// [`as_flattened_mut`]: slice::as_flattened_mut
+/// [`as_flattened`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_flattened
+/// [`as_flattened_mut`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_flattened_mut
 #[cfg(not(CONFIG_RUSTC_HAS_SLICE_AS_FLATTENED))]
 pub trait AsFlattened<T> {
     /// Takes a `&[[T; N]]` and flattens it to a `&[T]`.
     ///
     /// This is an portable layer on top of [`as_flattened`]; see its documentation for details.
     ///
-    /// [`as_flattened`]: slice::as_flattened
+    /// [`as_flattened`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_flattened
     fn as_flattened(&self) -> &[T];

     /// Takes a `&mut [[T; N]]` and flattens it to a `&mut [T]`.
     ///
     /// This is an portable layer on top of [`as_flattened_mut`]; see its documentation for details.
     ///
-    /// [`as_flattened_mut`]: slice::as_flattened_mut
+    /// [`as_flattened_mut`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_flattened_mut
     fn as_flattened_mut(&mut self) -> &mut [T];
 }

--
2.52.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ