Skip to content

Commit 333f802

Browse files
committed
rustdoc::broken_intra_doc_links: no backticks = use old behavior
this is in an effort to reduce the amount of code churn caused by this lint triggering on text that was never meant to be a link. a more principled hierustic for ignoring lints is not possible without extensive changes, due to the lint emitting code being so far away from the link collecting code, and the fact that only the link collecting code has access to details about how the link appears in the unnormalized markdown.
1 parent 6747e21 commit 333f802

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
@@ -986,7 +986,9 @@ fn preprocess_link(
986986
}
987987
};
988988

989-
if can_be_url && should_ignore_link(path_str) {
989+
// If there's no backticks, be lenient revert to old behavior.
990+
// This is to prevent churn by linting on stuff that isn't meant to be a link.
991+
if (can_be_url || !ori_link.link.contains('`')) && should_ignore_link(path_str) {
990992
return None;
991993
}
992994

0 commit comments

Comments
 (0)