Skip to content

Commit 1ba0c40

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

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
@@ -933,7 +933,9 @@ fn preprocess_link(
933933
// certain link kinds cannot have their path be urls,
934934
// so they should not be ignored, no matter how much they look like urls.
935935
// e.g. [https://example.com/] is not a link to example.com.
936-
let can_be_url = ori_link.kind == LinkType::Inline || ori_link.kind == LinkType::Autolink;
936+
let can_be_url = ori_link.kind != LinkType::ShortcutUnknown &&
937+
ori_link.kind != LinkType::CollapsedUnknown &&
938+
ori_link.kind != LinkType::ReferenceUnknown;
937939

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

0 commit comments

Comments
 (0)