Skip to content

Commit

Permalink
Remove unneeded argument of LinkCollector::verify_disambiguator
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 8, 2024
1 parent 126cb9b commit c9b4d1b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ impl LinkCollector<'_, '_> {
// valid omission. See https://github.com/rust-lang/rust/pull/80660#discussion_r551585677
// for discussion on the matter.
let kind = self.cx.tcx.def_kind(id);
self.verify_disambiguator(path_str, kind, id, disambiguator, item, &diag_info)?;
self.verify_disambiguator(path_str, kind, id, disambiguator, &diag_info)?;
} else {
match disambiguator {
Some(Disambiguator::Primitive | Disambiguator::Namespace(_)) | None => {}
Expand Down Expand Up @@ -1090,7 +1090,6 @@ impl LinkCollector<'_, '_> {
kind_for_dis,
id_for_dis,
disambiguator,
item,
&diag_info,
)?;

Expand All @@ -1111,7 +1110,6 @@ impl LinkCollector<'_, '_> {
kind: DefKind,
id: DefId,
disambiguator: Option<Disambiguator>,
item: &Item,
diag_info: &DiagnosticInfo<'_>,
) -> Option<()> {
debug!("intra-doc link to {path_str} resolved to {:?}", (kind, id));
Expand All @@ -1138,7 +1136,7 @@ impl LinkCollector<'_, '_> {

// item can be non-local e.g. when using `#[rustc_doc_primitive = "pointer"]`
if let Some((src_id, dst_id)) = id.as_local().and_then(|dst_id| {
item.item_id.expect_def_id().as_local().map(|src_id| (src_id, dst_id))
diag_info.item.item_id.expect_def_id().as_local().map(|src_id| (src_id, dst_id))
}) {
if self.cx.tcx.effective_visibilities(()).is_exported(src_id)
&& !self.cx.tcx.effective_visibilities(()).is_exported(dst_id)
Expand Down

0 comments on commit c9b4d1b

Please sign in to comment.