Only store a LocalDefId in hir::ForeignItem.
This commit is contained in:
parent
786a80e9ea
commit
996dc8d5c5
32 changed files with 133 additions and 110 deletions
|
|
@ -2239,10 +2239,10 @@ fn clean_use_statement(
|
|||
impl Clean<Item> for (&hir::ForeignItem<'_>, Option<Symbol>) {
|
||||
fn clean(&self, cx: &DocContext<'_>) -> Item {
|
||||
let (item, renamed) = self;
|
||||
cx.with_param_env(cx.tcx.hir().local_def_id(item.hir_id).to_def_id(), || {
|
||||
cx.with_param_env(item.def_id.to_def_id(), || {
|
||||
let kind = match item.kind {
|
||||
hir::ForeignItemKind::Fn(ref decl, ref names, ref generics) => {
|
||||
let abi = cx.tcx.hir().get_foreign_abi(item.hir_id);
|
||||
let abi = cx.tcx.hir().get_foreign_abi(item.hir_id());
|
||||
let (generics, decl) = enter_impl_trait(cx, || {
|
||||
(generics.clean(cx), (&**decl, &names[..]).clean(cx))
|
||||
});
|
||||
|
|
@ -2264,7 +2264,7 @@ impl Clean<Item> for (&hir::ForeignItem<'_>, Option<Symbol>) {
|
|||
};
|
||||
|
||||
Item::from_hir_id_and_parts(
|
||||
item.hir_id,
|
||||
item.hir_id(),
|
||||
Some(renamed.unwrap_or(item.ident.name)),
|
||||
kind,
|
||||
cx,
|
||||
|
|
|
|||
|
|
@ -1080,9 +1080,15 @@ impl<'a, 'hir, 'tcx> intravisit::Visitor<'hir> for HirCollector<'a, 'hir, 'tcx>
|
|||
}
|
||||
|
||||
fn visit_foreign_item(&mut self, item: &'hir hir::ForeignItem<'_>) {
|
||||
self.visit_testable(item.ident.to_string(), &item.attrs, item.hir_id, item.span, |this| {
|
||||
intravisit::walk_foreign_item(this, item);
|
||||
});
|
||||
self.visit_testable(
|
||||
item.ident.to_string(),
|
||||
&item.attrs,
|
||||
item.hir_id(),
|
||||
item.span,
|
||||
|this| {
|
||||
intravisit::walk_foreign_item(this, item);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
fn visit_variant(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue