Skip to content

Commit dce666b

Browse files
committed
Copy ty::AssocItem even in rustdoc
1 parent a32d392 commit dce666b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -689,12 +689,12 @@ fn resolve_associated_trait_item<'a>(
689689
.find_by_name_and_namespace(cx.tcx, Ident::with_dummy_span(item_name), ns, trait_)
690690
.map(|trait_assoc| {
691691
trait_assoc_to_impl_assoc_item(cx.tcx, impl_, trait_assoc.def_id)
692-
.unwrap_or(trait_assoc)
692+
.unwrap_or(*trait_assoc)
693693
})
694694
});
695695
// FIXME(#74563): warn about ambiguity
696696
debug!("the candidates were {:?}", candidates.clone().collect::<Vec<_>>());
697-
candidates.next().copied()
697+
candidates.next()
698698
}
699699

700700
/// Find the associated item in the impl `impl_id` that corresponds to the
@@ -711,7 +711,7 @@ fn trait_assoc_to_impl_assoc_item<'tcx>(
711711
tcx: TyCtxt<'tcx>,
712712
impl_id: DefId,
713713
trait_assoc_id: DefId,
714-
) -> Option<&'tcx ty::AssocItem> {
714+
) -> Option<ty::AssocItem> {
715715
let trait_to_impl_assoc_map = tcx.impl_item_implementor_ids(impl_id);
716716
debug!(?trait_to_impl_assoc_map);
717717
let impl_assoc_id = *trait_to_impl_assoc_map.get(&trait_assoc_id)?;

0 commit comments

Comments
 (0)