Add warn level lint redundant_explicit_links

- Currently it will panic due to the resolution's caching issue
This commit is contained in:
Kyle Lin 2023-06-29 13:24:09 +08:00
parent b1d232a6da
commit da582a71d2
4 changed files with 130 additions and 11 deletions

View file

@ -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
```