Skip to content

Commit

Permalink
Rollup merge of rust-lang#59037 - Manishearth:intra-doc-false, r=Quie…
Browse files Browse the repository at this point in the history
…tMisdreavus

Avoid some common false positives in intra doc link checking

The empty string case is never going to be a link. The numeric case may be a link, but if it were it would have resolved locally. It's more likely the makeshift markdown footnote notation (`[0]`, etc)

r? @QuietMisdreavus
  • Loading branch information
pietroalbini authored Mar 13, 2019
2 parents a0f0b1b + a4ea084 commit b0d7611
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,12 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
if ori_link.contains('/') {
continue;
}

// [] is mostly likely not supposed to be a link
if ori_link.is_empty() {
continue;
}

let link = ori_link.replace("`", "");
let (def, fragment) = {
let mut kind = PathKind::Unknown;
Expand Down

0 comments on commit b0d7611

Please sign in to comment.