@@ -1124,7 +1124,7 @@ impl LinkCollector<'_, '_> {
1124
1124
} else {
1125
1125
// `[char]` when a `char` module is in scope
1126
1126
let candidates = vec ! [ res, prim] ;
1127
- ambiguity_error ( self . cx , & item , path_str, dox , ori_link . range , candidates) ;
1127
+ ambiguity_error ( self . cx , diag_info , path_str, candidates) ;
1128
1128
return None ;
1129
1129
}
1130
1130
}
@@ -1413,14 +1413,7 @@ impl LinkCollector<'_, '_> {
1413
1413
}
1414
1414
// If we're reporting an ambiguity, don't mention the namespaces that failed
1415
1415
let candidates = candidates. map ( |candidate| candidate. ok ( ) . map ( |( res, _) | res) ) ;
1416
- ambiguity_error (
1417
- self . cx ,
1418
- diag. item ,
1419
- path_str,
1420
- diag. dox ,
1421
- diag. link_range ,
1422
- candidates. present_items ( ) . collect ( ) ,
1423
- ) ;
1416
+ ambiguity_error ( self . cx , diag, path_str, candidates. present_items ( ) . collect ( ) ) ;
1424
1417
None
1425
1418
}
1426
1419
}
@@ -1983,10 +1976,8 @@ fn disambiguator_error(
1983
1976
/// Report an ambiguity error, where there were multiple possible resolutions.
1984
1977
fn ambiguity_error (
1985
1978
cx : & DocContext < ' _ > ,
1986
- item : & Item ,
1979
+ DiagnosticInfo { item, ori_link : _ , dox , link_range } : DiagnosticInfo < ' _ > ,
1987
1980
path_str : & str ,
1988
- dox : & str ,
1989
- link_range : Range < usize > ,
1990
1981
candidates : Vec < Res > ,
1991
1982
) {
1992
1983
let mut msg = format ! ( "`{}` is " , path_str) ;
0 commit comments