* [PATCH] rust: slice: fix broken intra-doc links
@ 2025-11-19 18:51 Miguel Ojeda
2025-11-19 18:52 ` Alice Ryhl
2025-11-20 1:56 ` Alexandre Courbot
0 siblings, 2 replies; 4+ messages in thread
From: Miguel Ojeda @ 2025-11-19 18:51 UTC (permalink / raw)
To: Alexandre Courbot, Danilo Krummrich, Alice Ryhl, Miguel Ojeda,
Alex Gaynor
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, rust-for-linux, linux-kernel,
patches
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@kernel.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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] rust: slice: fix broken intra-doc links
2025-11-19 18:51 [PATCH] rust: slice: fix broken intra-doc links Miguel Ojeda
@ 2025-11-19 18:52 ` Alice Ryhl
2025-11-20 1:56 ` Alexandre Courbot
1 sibling, 0 replies; 4+ messages in thread
From: Alice Ryhl @ 2025-11-19 18:52 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Alexandre Courbot, Danilo Krummrich, Alex Gaynor, Boqun Feng,
Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, rust-for-linux, linux-kernel, patches
On Wed, Nov 19, 2025 at 7:51 PM Miguel Ojeda <ojeda@kernel.org> wrote:
>
> 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@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rust: slice: fix broken intra-doc links
2025-11-19 18:51 [PATCH] rust: slice: fix broken intra-doc links Miguel Ojeda
2025-11-19 18:52 ` Alice Ryhl
@ 2025-11-20 1:56 ` Alexandre Courbot
2025-11-20 9:59 ` Alice Ryhl
1 sibling, 1 reply; 4+ messages in thread
From: Alexandre Courbot @ 2025-11-20 1:56 UTC (permalink / raw)
To: Miguel Ojeda, Alexandre Courbot, Danilo Krummrich, Alice Ryhl,
Alex Gaynor
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, rust-for-linux, linux-kernel,
patches
On Thu Nov 20, 2025 at 3:51 AM JST, Miguel Ojeda wrote:
> 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@kernel.org>
> ---
> I have seen this in -next -- please feel free to take it or rebase if
> preferred etc., of course. Thanks!
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Alice, I guess we will want to take this into drm-rust-next or
drm-rust-fixes since that's where the patch introducing this originates
from?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rust: slice: fix broken intra-doc links
2025-11-20 1:56 ` Alexandre Courbot
@ 2025-11-20 9:59 ` Alice Ryhl
0 siblings, 0 replies; 4+ messages in thread
From: Alice Ryhl @ 2025-11-20 9:59 UTC (permalink / raw)
To: Alexandre Courbot
Cc: Miguel Ojeda, Danilo Krummrich, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, rust-for-linux, linux-kernel, patches
On Thu, Nov 20, 2025 at 10:56:29AM +0900, Alexandre Courbot wrote:
> On Thu Nov 20, 2025 at 3:51 AM JST, Miguel Ojeda wrote:
> > 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@kernel.org>
> > ---
> > I have seen this in -next -- please feel free to take it or rebase if
> > preferred etc., of course. Thanks!
>
> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
>
> Alice, I guess we will want to take this into drm-rust-next or
> drm-rust-fixes since that's where the patch introducing this originates
> from?
Yes, it goes in drm-rust-next:
After -rc6, the branch is open for fixing bugs introduced by
patches queued up in drm-rust-next for the upcoming merge window
only.
I will take the patch.
Alice
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-11-20 9:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19 18:51 [PATCH] rust: slice: fix broken intra-doc links Miguel Ojeda
2025-11-19 18:52 ` Alice Ryhl
2025-11-20 1:56 ` Alexandre Courbot
2025-11-20 9:59 ` Alice Ryhl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).