Re: [PATCH 12/13] rust: kernel: remove unneeded doclink targets

From: Trevor Gross
Date: Wed Jan 17 2024 - 20:22:11 EST


On Tue, Jan 16, 2024 at 7:16 PM Valentin Obst <kernel@xxxxxxxxxxxxxxx> wrote:
>
> Remove explicit targets for doclinks in cases where rustdoc can
> determine the correct target by itself. The goal is to reduce verbosity
> in the source code.
>
> Signed-off-by: Valentin Obst <kernel@xxxxxxxxxxxxxxx>
> ---
> rust/kernel/workqueue.rs | 10 ----------
> 1 file changed, 10 deletions(-)
>
> diff --git a/rust/kernel/workqueue.rs b/rust/kernel/workqueue.rs
> index aedf47f258bd..f63190b563d8 100644
> --- a/rust/kernel/workqueue.rs
> +++ b/rust/kernel/workqueue.rs
> @@ -426,13 +426,10 @@ pub unsafe fn raw_get(ptr: *const Self) -> *mut bindings::work_struct {
> /// The [`OFFSET`] constant must be the offset of a field in `Self` of type [`Work<T, ID>`]. The
> /// methods on this trait must have exactly the behavior that the definitions given below have.
> ///
> -/// [`Work<T, ID>`]: Work
> [...]

Just for reference, this behavior is described at
https://doc.rust-lang.org/rustdoc/write-documentation/linking-to-items-by-name.html#valid-links:

> You can also refer to items with generic parameters like Vec<T>. The
> link will resolve as if you had written [`Vec<T>`](Vec)