From da582a71d2c19a2ded0c45f464cb64c9544c26eb Mon Sep 17 00:00:00 2001 From: Kyle Lin Date: Thu, 29 Jun 2023 13:24:09 +0800 Subject: Add warn level lint `redundant_explicit_links` - Currently it will panic due to the resolution's caching issue --- src/doc/rustdoc/src/lints.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/doc') diff --git a/src/doc/rustdoc/src/lints.md b/src/doc/rustdoc/src/lints.md index fd57b079644..fe06b303e72 100644 --- a/src/doc/rustdoc/src/lints.md +++ b/src/doc/rustdoc/src/lints.md @@ -412,3 +412,25 @@ help: if you meant to use a literal backtick, escape it warning: 1 warning emitted ``` + +## `redundant_explicit_links` + +This lint is **warned by default**. It detects explicit links that are same +as computed automatic links. +This usually means the explicit links is removeable. For example: + +```rust +#![warn(rustdoc::redundant_explicit_links)] + +pub fn dummy_target() {} // note: unnecessary - warns by default. + +/// [`dummy_target`](dummy_target) +/// [dummy_target](dummy_target) +pub fn c() {} +``` + +Which will give: + +```text + +``` -- cgit 1.4.1-3-g733a5