@@ -1023,11 +1023,9 @@ impl LinkCollector<'_, '_> {
1023
1023
debug ! ( "attempting to resolve item without parent module: {}" , path_str) ;
1024
1024
resolution_failure (
1025
1025
self ,
1026
- & item ,
1026
+ diag_info ,
1027
1027
path_str,
1028
1028
disambiguator,
1029
- dox,
1030
- ori_link. range ,
1031
1029
smallvec ! [ ResolutionFailure :: NoParentItem ] ,
1032
1030
) ;
1033
1031
return None ;
@@ -1073,11 +1071,9 @@ impl LinkCollector<'_, '_> {
1073
1071
debug ! ( "link has malformed generics: {}" , path_str) ;
1074
1072
resolution_failure (
1075
1073
self ,
1076
- & item ,
1074
+ diag_info ,
1077
1075
path_str,
1078
1076
disambiguator,
1079
- dox,
1080
- ori_link. range ,
1081
1077
smallvec ! [ err_kind] ,
1082
1078
) ;
1083
1079
return None ;
@@ -1337,15 +1333,7 @@ impl LinkCollector<'_, '_> {
1337
1333
}
1338
1334
}
1339
1335
}
1340
- resolution_failure (
1341
- self ,
1342
- diag. item ,
1343
- path_str,
1344
- disambiguator,
1345
- diag. dox ,
1346
- diag. link_range ,
1347
- smallvec ! [ kind] ,
1348
- ) ;
1336
+ resolution_failure ( self , diag, path_str, disambiguator, smallvec ! [ kind] ) ;
1349
1337
// This could just be a normal link or a broken link
1350
1338
// we could potentially check if something is
1351
1339
// "intra-doc-link-like" and warn in that case.
@@ -1406,11 +1394,9 @@ impl LinkCollector<'_, '_> {
1406
1394
if len == 0 {
1407
1395
resolution_failure (
1408
1396
self ,
1409
- diag. item ,
1397
+ diag,
1410
1398
path_str,
1411
1399
disambiguator,
1412
- diag. dox ,
1413
- diag. link_range ,
1414
1400
candidates. into_iter ( ) . filter_map ( |res| res. err ( ) ) . collect ( ) ,
1415
1401
) ;
1416
1402
// this could just be a normal link
@@ -1452,15 +1438,7 @@ impl LinkCollector<'_, '_> {
1452
1438
break ;
1453
1439
}
1454
1440
}
1455
- resolution_failure (
1456
- self ,
1457
- diag. item ,
1458
- path_str,
1459
- disambiguator,
1460
- diag. dox ,
1461
- diag. link_range ,
1462
- smallvec ! [ kind] ,
1463
- ) ;
1441
+ resolution_failure ( self , diag, path_str, disambiguator, smallvec ! [ kind] ) ;
1464
1442
None
1465
1443
}
1466
1444
}
@@ -1750,11 +1728,9 @@ fn report_diagnostic(
1750
1728
/// `std::io::Error::x`, this will resolve `std::io::Error`.
1751
1729
fn resolution_failure (
1752
1730
collector : & mut LinkCollector < ' _ , ' _ > ,
1753
- item : & Item ,
1731
+ DiagnosticInfo { item, ori_link : _ , dox , link_range } : DiagnosticInfo < ' _ > ,
1754
1732
path_str : & str ,
1755
1733
disambiguator : Option < Disambiguator > ,
1756
- dox : & str ,
1757
- link_range : Range < usize > ,
1758
1734
kinds : SmallVec < [ ResolutionFailure < ' _ > ; 3 ] > ,
1759
1735
) {
1760
1736
let tcx = collector. cx . tcx ;
0 commit comments