forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#77859 - bugadani:no-duplicate-ref-link-error,…
… r=jyn514 Rustdoc: only report broken ref-style links once This PR assigns the markdown `LinkType` to each parsed link and passes this information into the link collector. If a link can't be resolved in `resolve_with_disambiguator`, the failure is cached for the link types where we only want to report the error once (namely `Shortcut` and `Reference`). Fixes rust-lang#77681
- Loading branch information
Showing
6 changed files
with
175 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#![deny(broken_intra_doc_links)] | ||
|
||
/// Links to [a] [link][a] | ||
/// And also a [third link][a] | ||
/// And also a [reference link][b] | ||
/// | ||
/// Other links to the same target should still emit error: [ref] //~ERROR unresolved link to `ref` | ||
/// Duplicate [ref] //~ERROR unresolved link to `ref` | ||
/// | ||
/// Other links to other targets should still emit error: [ref2] //~ERROR unresolved link to `ref2` | ||
/// Duplicate [ref2] //~ERROR unresolved link to `ref2` | ||
/// | ||
/// [a]: ref | ||
//~^ ERROR unresolved link to `ref` | ||
/// [b]: ref2 | ||
//~^ ERROR unresolved link to | ||
|
||
/// [ref][] | ||
//~^ ERROR unresolved link | ||
pub fn f() {} |
Oops, something went wrong.