diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 56545983d42..d14953f1bb7 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -90,7 +90,7 @@ pub(crate) fn clean_doc_module<'tcx>(doc: &DocModule<'tcx>, cx: &mut DocContext< } v })); - items.extend(doc.inlined_foreigns.values().flat_map(|(res, renamed, local_import_id)| { + items.extend(doc.inlined_foreigns.iter().flat_map(|((_, renamed), (res, local_import_id))| { let Some(def_id) = res.opt_def_id() else { return Vec::new() }; let name = renamed.unwrap_or_else(|| cx.tcx.item_name(def_id)); let import = cx.tcx.hir().expect_item(*local_import_id); diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index cee3995eff4..66737a01521 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -36,8 +36,7 @@ pub(crate) struct Module<'hir> { (&'hir hir::Item<'hir>, Option, Option), >, /// Same as for `items`. - pub(crate) inlined_foreigns: - FxIndexMap<(DefId, Option), (Res, Option, LocalDefId)>, + pub(crate) inlined_foreigns: FxIndexMap<(DefId, Option), (Res, LocalDefId)>, pub(crate) foreigns: Vec<(&'hir hir::ForeignItem<'hir>, Option)>, } @@ -295,7 +294,7 @@ fn maybe_inline_local( .last_mut() .unwrap() .inlined_foreigns - .insert((ori_res_did, renamed), (res, renamed, def_id)); + .insert((ori_res_did, renamed), (res, def_id)); return true; };