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
kennytm committed Mar 11, 2019
2 parents 23fe082 + a4ea084 commit 0614b1c
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 0614b1c

Please sign in to comment.