@@ -829,16 +829,13 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
829
829
}
830
830
let candidates =
831
831
candidates. map ( |candidate| candidate. map ( |( res, _) | res) ) ;
832
- let candidates = [ TypeNS , ValueNS , MacroNS ]
833
- . iter ( )
834
- . filter_map ( |& ns| candidates[ ns] . map ( |res| ( res, ns) ) ) ;
835
832
ambiguity_error (
836
833
cx,
837
834
& item,
838
835
path_str,
839
836
& dox,
840
837
link_range,
841
- candidates. collect ( ) ,
838
+ candidates. present_items ( ) . collect ( ) ,
842
839
) ;
843
840
continue ;
844
841
}
@@ -880,7 +877,7 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
880
877
fragment = Some ( path. to_owned ( ) ) ;
881
878
} else {
882
879
// `[char]` when a `char` module is in scope
883
- let candidates = vec ! [ ( res, TypeNS ) , ( prim, TypeNS ) ] ;
880
+ let candidates = vec ! [ res, prim] ;
884
881
ambiguity_error ( cx, & item, path_str, & dox, link_range, candidates) ;
885
882
continue ;
886
883
}
@@ -1251,12 +1248,12 @@ fn ambiguity_error(
1251
1248
path_str : & str ,
1252
1249
dox : & str ,
1253
1250
link_range : Option < Range < usize > > ,
1254
- candidates : Vec < ( Res , Namespace ) > ,
1251
+ candidates : Vec < Res > ,
1255
1252
) {
1256
1253
let mut msg = format ! ( "`{}` is " , path_str) ;
1257
1254
1258
1255
match candidates. as_slice ( ) {
1259
- [ ( first_def, _ ) , ( second_def, _ ) ] => {
1256
+ [ first_def, second_def] => {
1260
1257
msg += & format ! (
1261
1258
"both {} {} and {} {}" ,
1262
1259
first_def. article( ) ,
@@ -1267,7 +1264,7 @@ fn ambiguity_error(
1267
1264
}
1268
1265
_ => {
1269
1266
let mut candidates = candidates. iter ( ) . peekable ( ) ;
1270
- while let Some ( ( res, _ ) ) = candidates. next ( ) {
1267
+ while let Some ( res) = candidates. next ( ) {
1271
1268
if candidates. peek ( ) . is_some ( ) {
1272
1269
msg += & format ! ( "{} {}, " , res. article( ) , res. descr( ) ) ;
1273
1270
} else {
@@ -1284,7 +1281,7 @@ fn ambiguity_error(
1284
1281
diag. note ( "ambiguous link" ) ;
1285
1282
}
1286
1283
1287
- for ( res, _ns ) in candidates {
1284
+ for res in candidates {
1288
1285
let disambiguator = Disambiguator :: from_res ( res) ;
1289
1286
suggest_disambiguator ( disambiguator, diag, path_str, dox, sp, & link_range) ;
1290
1287
}
0 commit comments