[1/3] rust: task: remove redundant explicit link

Message ID 20231005210556.466856-2-ojeda@kernel.org
State New
Headers
Series Rust 1.73.0 upgrade |

Commit Message

Miguel Ojeda Oct. 5, 2023, 9:05 p.m. UTC
  Starting with Rust 1.73.0, `rustdoc` detects redundant explicit
links with its new lint `redundant_explicit_links` [1]:

    error: redundant explicit link target
      --> rust/kernel/task.rs:85:21
       |
    85 |     /// [`current`](crate::current) macro because it is safe.
       |          ---------  ^^^^^^^^^^^^^^ explicit target is redundant
       |          |
       |          because label contains path that resolves to same destination
       |
       = note: when a link's destination is not specified,
               the label is used to resolve intra-doc links
       = note: `-D rustdoc::redundant-explicit-links` implied by `-D warnings`
    help: remove explicit link target
       |
    85 |     /// [`current`] macro because it is safe.

In order to avoid the warning in the compiler upgrade commit,
make it an intra-doc link as the tool suggests.

Link: https://github.com/rust-lang/rust/pull/113167 [1]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 rust/kernel/task.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Martin Rodriguez Reboredo Oct. 5, 2023, 9:29 p.m. UTC | #1
On 10/5/23 18:05, Miguel Ojeda wrote:
> Starting with Rust 1.73.0, `rustdoc` detects redundant explicit
> links with its new lint `redundant_explicit_links` [1]:
> 
>      error: redundant explicit link target
>        --> rust/kernel/task.rs:85:21
>         |
>      85 |     /// [`current`](crate::current) macro because it is safe.
>         |          ---------  ^^^^^^^^^^^^^^ explicit target is redundant
>         |          |
>         |          because label contains path that resolves to same destination
>         |
>         = note: when a link's destination is not specified,
>                 the label is used to resolve intra-doc links
>         = note: `-D rustdoc::redundant-explicit-links` implied by `-D warnings`
>      help: remove explicit link target
>         |
>      85 |     /// [`current`] macro because it is safe.
> 
> In order to avoid the warning in the compiler upgrade commit,
> make it an intra-doc link as the tool suggests.
> 
> Link: https://github.com/rust-lang/rust/pull/113167 [1]
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
> ---
> [...]
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
  
Finn Behrens Oct. 6, 2023, 8:17 a.m. UTC | #2
On 5 Oct 2023, at 23:05, Miguel Ojeda wrote:

> Starting with Rust 1.73.0, `rustdoc` detects redundant explicit
> links with its new lint `redundant_explicit_links` [1]:
>
>     error: redundant explicit link target
>       --> rust/kernel/task.rs:85:21
>        |
>     85 |     /// [`current`](crate::current) macro because it is safe.
>        |          ---------  ^^^^^^^^^^^^^^ explicit target is redundant
>        |          |
>        |          because label contains path that resolves to same destination
>        |
>        = note: when a link's destination is not specified,
>                the label is used to resolve intra-doc links
>        = note: `-D rustdoc::redundant-explicit-links` implied by `-D warnings`
>     help: remove explicit link target
>        |
>     85 |     /// [`current`] macro because it is safe.
>
> In order to avoid the warning in the compiler upgrade commit,
> make it an intra-doc link as the tool suggests.
>
> Link: https://github.com/rust-lang/rust/pull/113167 [1]
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
> ---

Reviewed-by: Finn Behrens <me@kloenk.dev>
  
Alice Ryhl Oct. 6, 2023, 8:51 a.m. UTC | #3
On Thu, Oct 5, 2023 at 11:06 PM Miguel Ojeda <ojeda@kernel.org> wrote:
> Starting with Rust 1.73.0, `rustdoc` detects redundant explicit
> links with its new lint `redundant_explicit_links` [1]:
>
>     error: redundant explicit link target
>       --> rust/kernel/task.rs:85:21
>        |
>     85 |     /// [`current`](crate::current) macro because it is safe.
>        |          ---------  ^^^^^^^^^^^^^^ explicit target is redundant
>        |          |
>        |          because label contains path that resolves to same destination
>        |
>        = note: when a link's destination is not specified,
>                the label is used to resolve intra-doc links
>        = note: `-D rustdoc::redundant-explicit-links` implied by `-D warnings`
>     help: remove explicit link target
>        |
>     85 |     /// [`current`] macro because it is safe.
>
> In order to avoid the warning in the compiler upgrade commit,
> make it an intra-doc link as the tool suggests.
>
> Link: https://github.com/rust-lang/rust/pull/113167 [1]
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
  
Vincenzo Palazzo Oct. 9, 2023, 8:48 a.m. UTC | #4
> Starting with Rust 1.73.0, `rustdoc` detects redundant explicit
> links with its new lint `redundant_explicit_links` [1]:
>
>     error: redundant explicit link target
>       --> rust/kernel/task.rs:85:21
>        |
>     85 |     /// [`current`](crate::current) macro because it is safe.
>        |          ---------  ^^^^^^^^^^^^^^ explicit target is redundant
>        |          |
>        |          because label contains path that resolves to same destination
>        |
>        = note: when a link's destination is not specified,
>                the label is used to resolve intra-doc links
>        = note: `-D rustdoc::redundant-explicit-links` implied by `-D warnings`
>     help: remove explicit link target
>        |
>     85 |     /// [`current`] macro because it is safe.
>
> In order to avoid the warning in the compiler upgrade commit,
> make it an intra-doc link as the tool suggests.
>
> Link: https://github.com/rust-lang/rust/pull/113167 [1]
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
> ---
Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
  

Patch

diff --git a/rust/kernel/task.rs b/rust/kernel/task.rs
index 7eda15e5f1b3..b2299bc7ac1f 100644
--- a/rust/kernel/task.rs
+++ b/rust/kernel/task.rs
@@ -82,7 +82,7 @@  impl Task {
     /// Returns a task reference for the currently executing task/thread.
     ///
     /// The recommended way to get the current task/thread is to use the
-    /// [`current`](crate::current) macro because it is safe.
+    /// [`current`] macro because it is safe.
     ///
     /// # Safety
     ///