Skip to content

Commit

Permalink
Rollup merge of #131408 - GuillaumeGomez:more-intra-doc-cleanup, r=no…
Browse files Browse the repository at this point in the history
…triddle

Remove unneeded argument of `LinkCollector::verify_disambiguator`

Still working on #130278. ^^'

r? `@notriddle`
  • Loading branch information
matthiaskrgr authored Oct 8, 2024
2 parents bb7232e + c9b4d1b commit cb252ee
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 @@ -1073,7 +1073,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 @@ -1102,7 +1102,6 @@ impl LinkCollector<'_, '_> {
kind_for_dis,
id_for_dis,
disambiguator,
item,
&diag_info,
)?;

Expand All @@ -1123,7 +1122,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 @@ -1150,7 +1148,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 cb252ee

Please sign in to comment.