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(), ), };