From 6e4ef54d79fa87701d4a11712f900994846b811e Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Mon, 5 Apr 2021 04:50:01 -0400 Subject: [PATCH] Rename path_str -> ori_link in anchor_failure ori_link contains anchors, path_str does not. It's important that anchor_failure be passed a link with the anchors still present. --- src/librustdoc/passes/collect_intra_doc_links.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index 545fbf26181..40a93855cf2 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -2005,16 +2005,16 @@ fn split(path: &str) -> Option<(&str, &str)> { fn anchor_failure( cx: &DocContext<'_>, item: &Item, - path_str: &str, + ori_link: &str, dox: &str, link_range: Range, failure: AnchorFailure, ) { let msg = match failure { - AnchorFailure::MultipleAnchors => format!("`{}` contains multiple anchors", path_str), + AnchorFailure::MultipleAnchors => format!("`{}` contains multiple anchors", ori_link), AnchorFailure::RustdocAnchorConflict(res) => format!( "`{}` contains an anchor, but links to {kind}s are already anchored", - path_str, + ori_link, kind = res.descr(), ), };