@@ -1192,7 +1192,7 @@ impl LinkCollector<'_, '_> {
1192
1192
if self . cx . tcx . privacy_access_levels ( LOCAL_CRATE ) . is_exported ( hir_src)
1193
1193
&& !self . cx . tcx . privacy_access_levels ( LOCAL_CRATE ) . is_exported ( hir_dst)
1194
1194
{
1195
- privacy_error ( self . cx , & item , & path_str, dox , & ori_link ) ;
1195
+ privacy_error ( self . cx , diag_info , & path_str) ;
1196
1196
}
1197
1197
}
1198
1198
@@ -2045,7 +2045,11 @@ fn suggest_disambiguator(
2045
2045
}
2046
2046
2047
2047
/// Report a link from a public item to a private one.
2048
- fn privacy_error ( cx : & DocContext < ' _ > , item : & Item , path_str : & str , dox : & str , link : & MarkdownLink ) {
2048
+ fn privacy_error (
2049
+ cx : & DocContext < ' _ > ,
2050
+ DiagnosticInfo { item, ori_link : _, dox, link_range } : DiagnosticInfo < ' _ > ,
2051
+ path_str : & str ,
2052
+ ) {
2049
2053
let sym;
2050
2054
let item_name = match item. name {
2051
2055
Some ( name) => {
@@ -2057,7 +2061,7 @@ fn privacy_error(cx: &DocContext<'_>, item: &Item, path_str: &str, dox: &str, li
2057
2061
let msg =
2058
2062
format ! ( "public documentation for `{}` links to private item `{}`" , item_name, path_str) ;
2059
2063
2060
- report_diagnostic ( cx. tcx , PRIVATE_INTRA_DOC_LINKS , & msg, item, dox, & link . range , |diag, sp| {
2064
+ report_diagnostic ( cx. tcx , PRIVATE_INTRA_DOC_LINKS , & msg, item, dox, & link_range , |diag, sp| {
2061
2065
if let Some ( sp) = sp {
2062
2066
diag. span_label ( sp, "this item is private" ) ;
2063
2067
}
0 commit comments