Skip to content

Commit 0614b1c

Browse files
authored
Rollup merge of rust-lang#59037 - Manishearth:intra-doc-false, r=QuietMisdreavus
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
2 parents 23fe082 + a4ea084 commit 0614b1c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

+6
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,12 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
288288
if ori_link.contains('/') {
289289
continue;
290290
}
291+
292+
// [] is mostly likely not supposed to be a link
293+
if ori_link.is_empty() {
294+
continue;
295+
}
296+
291297
let link = ori_link.replace("`", "");
292298
let (def, fragment) = {
293299
let mut kind = PathKind::Unknown;

0 commit comments

Comments
 (0)