Skip to content

Commit f4c87c5

Browse files
committed
Take DiagnosticInfo in ambiguity_error
1 parent 58f9c5b commit f4c87c5

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ impl LinkCollector<'_, '_> {
11241124
} else {
11251125
// `[char]` when a `char` module is in scope
11261126
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);
11281128
return None;
11291129
}
11301130
}
@@ -1413,14 +1413,7 @@ impl LinkCollector<'_, '_> {
14131413
}
14141414
// If we're reporting an ambiguity, don't mention the namespaces that failed
14151415
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());
14241417
None
14251418
}
14261419
}
@@ -1983,10 +1976,8 @@ fn disambiguator_error(
19831976
/// Report an ambiguity error, where there were multiple possible resolutions.
19841977
fn ambiguity_error(
19851978
cx: &DocContext<'_>,
1986-
item: &Item,
1979+
DiagnosticInfo { item, ori_link: _, dox, link_range }: DiagnosticInfo<'_>,
19871980
path_str: &str,
1988-
dox: &str,
1989-
link_range: Range<usize>,
19901981
candidates: Vec<Res>,
19911982
) {
19921983
let mut msg = format!("`{}` is ", path_str);

0 commit comments

Comments
 (0)