Skip to content

Commit a4ea084

Browse files
committed
Avoid some common false positives in intra doc link checking
1 parent b2ea6c8 commit a4ea084

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
@@ -291,6 +291,12 @@ impl<'a, 'tcx, 'rcx> DocFolder for LinkCollector<'a, 'tcx, 'rcx> {
291291
if ori_link.contains('/') {
292292
continue;
293293
}
294+
295+
// [] is mostly likely not supposed to be a link
296+
if ori_link.is_empty() {
297+
continue;
298+
}
299+
294300
let link = ori_link.replace("`", "");
295301
let (def, fragment) = {
296302
let mut kind = PathKind::Unknown;

0 commit comments

Comments
 (0)