Skip to content

Commit 57dc2ea

Browse files
ojedaDarksonn
authored andcommitted
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: 8862232 ("rust: enable slice_flatten feature and provide it through an extension trait") Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://patch.msgid.link/20251119185125.1411151-1-ojeda@kernel.org Signed-off-by: Alice Ryhl <aliceryhl@google.com>
1 parent f0ded97 commit 57dc2ea

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

rust/kernel/slice.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@
1616
///
1717
/// This trait can be removed once the MSRV passes 1.80.
1818
///
19-
/// [`as_flattened`]: slice::as_flattened
20-
/// [`as_flattened_mut`]: slice::as_flattened_mut
19+
/// [`as_flattened`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_flattened
20+
/// [`as_flattened_mut`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_flattened_mut
2121
#[cfg(not(CONFIG_RUSTC_HAS_SLICE_AS_FLATTENED))]
2222
pub trait AsFlattened<T> {
2323
/// Takes a `&[[T; N]]` and flattens it to a `&[T]`.
2424
///
2525
/// This is an portable layer on top of [`as_flattened`]; see its documentation for details.
2626
///
27-
/// [`as_flattened`]: slice::as_flattened
27+
/// [`as_flattened`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_flattened
2828
fn as_flattened(&self) -> &[T];
2929

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

0 commit comments

Comments
 (0)