Skip to content

Commit 53cb8b0

Browse files
Update src/librustdoc/passes/collect_intra_doc_links.rs
fix link kind check Co-authored-by: Michael Howell <[email protected]>
1 parent ca4b042 commit 53cb8b0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,9 @@ fn preprocess_link(
934934
// certain link kinds cannot have their path be urls,
935935
// so they should not be ignored, no matter how much they look like urls.
936936
// e.g. [https://example.com/] is not a link to example.com.
937-
let can_be_url = ori_link.kind == LinkType::Inline || ori_link.kind == LinkType::Autolink;
937+
let can_be_url = ori_link.kind != LinkType::ShortcutUnknown &&
938+
ori_link.kind != LinkType::CollapsedUnknown &&
939+
ori_link.kind != LinkType::ReferenceUnknown;
938940

939941
// [] is mostly likely not supposed to be a link
940942
if ori_link.link.is_empty() {

0 commit comments

Comments
 (0)