Remove unneeded Option<Symbol>
in foreign_items
This commit is contained in:
parent
c845a53aa2
commit
afec6d242b
@ -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);
|
||||
|
@ -36,8 +36,7 @@ pub(crate) struct Module<'hir> {
|
||||
(&'hir hir::Item<'hir>, Option<Symbol>, Option<LocalDefId>),
|
||||
>,
|
||||
/// Same as for `items`.
|
||||
pub(crate) inlined_foreigns:
|
||||
FxIndexMap<(DefId, Option<Symbol>), (Res, Option<Symbol>, LocalDefId)>,
|
||||
pub(crate) inlined_foreigns: FxIndexMap<(DefId, Option<Symbol>), (Res, LocalDefId)>,
|
||||
pub(crate) foreigns: Vec<(&'hir hir::ForeignItem<'hir>, Option<Symbol>)>,
|
||||
}
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user