hir::ItemKind::Mod(_) => {
as_primitive(Res::Def(
DefKind::Mod,
- cx.tcx.hir().local_def_id_from_hir_id(id.id),
+ cx.tcx.hir().local_def_id(id.id),
))
}
hir::ItemKind::Use(ref path, hir::UseKind::Single)
if item.vis.node.is_pub() => {
as_primitive(path.res).map(|(_, prim, attrs)| {
// Pretend the primitive is local.
- (cx.tcx.hir().local_def_id_from_hir_id(id.id), prim, attrs)
+ (cx.tcx.hir().local_def_id(id.id), prim, attrs)
})
}
_ => None
hir::ItemKind::Mod(_) => {
as_keyword(Res::Def(
DefKind::Mod,
- cx.tcx.hir().local_def_id_from_hir_id(id.id),
+ cx.tcx.hir().local_def_id(id.id),
))
}
hir::ItemKind::Use(ref path, hir::UseKind::Single)
if item.vis.node.is_pub() => {
as_keyword(path.res).map(|(_, prim, attrs)| {
- (cx.tcx.hir().local_def_id_from_hir_id(id.id), prim, attrs)
+ (cx.tcx.hir().local_def_id(id.id), prim, attrs)
})
}
_ => None
visibility: self.vis.clean(cx),
stability: self.stab.clean(cx),
deprecation: self.depr.clean(cx),
- def_id: cx.tcx.hir().local_def_id(self.id),
+ def_id: cx.tcx.hir().local_def_id_from_node_id(self.id),
inner: ModuleItem(Module {
is_crate: self.is_crate,
items,
}
hir::GenericParamKind::Type { ref default, synthetic } => {
(self.name.ident().name.clean(cx), GenericParamDefKind::Type {
- did: cx.tcx.hir().local_def_id_from_hir_id(self.hir_id),
+ did: cx.tcx.hir().local_def_id(self.hir_id),
bounds: self.bounds.clean(cx),
default: default.clean(cx),
synthetic: synthetic,
}
hir::GenericParamKind::Const { ref ty } => {
(self.name.ident().name.clean(cx), GenericParamDefKind::Const {
- did: cx.tcx.hir().local_def_id_from_hir_id(self.hir_id),
+ did: cx.tcx.hir().local_def_id(self.hir_id),
ty: ty.clean(cx),
})
}
(self.generics.clean(cx), (self.decl, self.body).clean(cx))
});
- let did = cx.tcx.hir().local_def_id_from_hir_id(self.id);
+ let did = cx.tcx.hir().local_def_id(self.id);
let constness = if cx.tcx.is_min_const_fn(did) {
hir::Constness::Const
} else {
name: Some(self.name.clean(cx)),
attrs: attrs,
source: self.whence.clean(cx),
- def_id: cx.tcx.hir().local_def_id_from_hir_id(self.id),
+ def_id: cx.tcx.hir().local_def_id(self.id),
visibility: self.vis.clean(cx),
stability: self.stab.clean(cx),
deprecation: self.depr.clean(cx),
name: Some(self.name.clean(cx)),
attrs,
source: self.whence.clean(cx),
- def_id: cx.tcx.hir().local_def_id_from_hir_id(self.id),
+ def_id: cx.tcx.hir().local_def_id(self.id),
visibility: self.vis.clean(cx),
stability: self.stab.clean(cx),
deprecation: self.depr.clean(cx),
AssocTypeItem(bounds.clean(cx), default.clean(cx))
}
};
- let local_did = cx.tcx.hir().local_def_id_from_hir_id(self.hir_id);
+ let local_did = cx.tcx.hir().local_def_id(self.hir_id);
Item {
name: Some(self.ident.name.clean(cx)),
attrs: self.attrs.clean(cx),
generics: Generics::default(),
}, true),
};
- let local_did = cx.tcx.hir().local_def_id_from_hir_id(self.hir_id);
+ let local_did = cx.tcx.hir().local_def_id(self.hir_id);
Item {
name: Some(self.ident.name.clean(cx)),
source: self.span.clean(cx),
}
TyKind::Slice(ref ty) => Slice(box ty.clean(cx)),
TyKind::Array(ref ty, ref length) => {
- let def_id = cx.tcx.hir().local_def_id_from_hir_id(length.hir_id);
+ let def_id = cx.tcx.hir().local_def_id(length.hir_id);
let param_env = cx.tcx.param_env(def_id);
let substs = InternalSubsts::identity_for_item(cx.tcx, def_id);
let cid = GlobalId {
if let Some(lt) = lifetime.cloned() {
if !lt.is_elided() {
let lt_def_id =
- cx.tcx.hir().local_def_id_from_hir_id(param.hir_id);
+ cx.tcx.hir().local_def_id(param.hir_id);
lt_substs.insert(lt_def_id, lt.clean(cx));
}
}
}
hir::GenericParamKind::Type { ref default, .. } => {
let ty_param_def_id =
- cx.tcx.hir().local_def_id_from_hir_id(param.hir_id);
+ cx.tcx.hir().local_def_id(param.hir_id);
let mut j = 0;
let type_ = generic_args.args.iter().find_map(|arg| {
match arg {
}
hir::GenericParamKind::Const { .. } => {
let const_param_def_id =
- cx.tcx.hir().local_def_id_from_hir_id(param.hir_id);
+ cx.tcx.hir().local_def_id(param.hir_id);
let mut j = 0;
let const_ = generic_args.args.iter().find_map(|arg| {
match arg {
ty::FnPtr(_) => {
let ty = cx.tcx.lift(self).expect("FnPtr lift failed");
let sig = ty.fn_sig(cx.tcx);
+ let local_def_id = cx.tcx.hir().local_def_id_from_node_id(ast::CRATE_NODE_ID);
BareFunction(box BareFunctionDecl {
unsafety: sig.unsafety(),
generic_params: Vec::new(),
- decl: (cx.tcx.hir().local_def_id(ast::CRATE_NODE_ID), sig).clean(cx),
+ decl: (local_def_id, sig).clean(cx),
abi: sig.abi(),
})
}
impl Clean<Item> for hir::StructField {
fn clean(&self, cx: &DocContext<'_>) -> Item {
- let local_did = cx.tcx.hir().local_def_id_from_hir_id(self.hir_id);
+ let local_did = cx.tcx.hir().local_def_id(self.hir_id);
Item {
name: Some(self.ident.name).clean(cx),
name: Some(self.name.clean(cx)),
attrs: self.attrs.clean(cx),
source: self.whence.clean(cx),
- def_id: cx.tcx.hir().local_def_id_from_hir_id(self.id),
+ def_id: cx.tcx.hir().local_def_id(self.id),
visibility: self.vis.clean(cx),
stability: self.stab.clean(cx),
deprecation: self.depr.clean(cx),
name: Some(self.name.clean(cx)),
attrs: self.attrs.clean(cx),
source: self.whence.clean(cx),
- def_id: cx.tcx.hir().local_def_id_from_hir_id(self.id),
+ def_id: cx.tcx.hir().local_def_id(self.id),
visibility: self.vis.clean(cx),
stability: self.stab.clean(cx),
deprecation: self.depr.clean(cx),
name: Some(self.name.clean(cx)),
attrs: self.attrs.clean(cx),
source: self.whence.clean(cx),
- def_id: cx.tcx.hir().local_def_id_from_hir_id(self.id),
+ def_id: cx.tcx.hir().local_def_id(self.id),
visibility: self.vis.clean(cx),
stability: self.stab.clean(cx),
deprecation: self.depr.clean(cx),
visibility: None,
stability: self.stab.clean(cx),
deprecation: self.depr.clean(cx),
- def_id: cx.tcx.hir().local_def_id_from_hir_id(self.id),
+ def_id: cx.tcx.hir().local_def_id(self.id),
inner: VariantItem(Variant {
kind: self.def.clean(cx),
}),
name: Some(self.name.clean(cx)),
attrs: self.attrs.clean(cx),
source: self.whence.clean(cx),
- def_id: cx.tcx.hir().local_def_id_from_hir_id(self.id),
+ def_id: cx.tcx.hir().local_def_id(self.id),
visibility: self.vis.clean(cx),
stability: self.stab.clean(cx),
deprecation: self.depr.clean(cx),
name: Some(self.name.clean(cx)),
attrs: self.attrs.clean(cx),
source: self.whence.clean(cx),
- def_id: cx.tcx.hir().local_def_id_from_hir_id(self.id),
+ def_id: cx.tcx.hir().local_def_id(self.id),
visibility: self.vis.clean(cx),
stability: self.stab.clean(cx),
deprecation: self.depr.clean(cx),
name: Some(self.name.clean(cx)),
attrs: self.attrs.clean(cx),
source: self.whence.clean(cx),
- def_id: cx.tcx.hir().local_def_id_from_hir_id(self.id),
+ def_id: cx.tcx.hir().local_def_id(self.id),
visibility: self.vis.clean(cx),
stability: self.stab.clean(cx),
deprecation: self.depr.clean(cx),
name: Some(self.name.clean(cx)),
attrs: self.attrs.clean(cx),
source: self.whence.clean(cx),
- def_id: cx.tcx.hir().local_def_id_from_hir_id(self.id),
+ def_id: cx.tcx.hir().local_def_id(self.id),
visibility: self.vis.clean(cx),
stability: self.stab.clean(cx),
deprecation: self.depr.clean(cx),
name: None,
attrs: self.attrs.clean(cx),
source: self.whence.clean(cx),
- def_id: cx.tcx.hir().local_def_id_from_hir_id(self.id),
+ def_id: cx.tcx.hir().local_def_id(self.id),
visibility: self.vis.clean(cx),
stability: self.stab.clean(cx),
deprecation: self.depr.clean(cx),
name: None,
attrs: self.attrs.clean(cx),
source: self.whence.clean(cx),
- def_id: cx.tcx.hir().local_def_id(ast::CRATE_NODE_ID),
+ def_id: cx.tcx.hir().local_def_id_from_node_id(ast::CRATE_NODE_ID),
visibility: self.vis.clean(cx),
stability: None,
deprecation: None,
name: Some(self.name.clean(cx)),
attrs: self.attrs.clean(cx),
source: self.whence.clean(cx),
- def_id: cx.tcx.hir().local_def_id_from_hir_id(self.id),
+ def_id: cx.tcx.hir().local_def_id(self.id),
visibility: self.vis.clean(cx),
stability: self.stab.clean(cx),
deprecation: self.depr.clean(cx),
MacroKind::Bang => (i, TypeKind::Macro),
MacroKind::Attr => (i, TypeKind::Attr),
MacroKind::Derive => (i, TypeKind::Derive),
- MacroKind::ProcMacroStub => unreachable!(),
},
Res::Def(DefKind::TraitAlias, i) => (i, TypeKind::TraitAlias),
Res::SelfTy(Some(def_id), _) => (def_id, TypeKind::Trait),
visibility: Some(Public),
stability: self.stab.clean(cx),
deprecation: self.depr.clean(cx),
- def_id: cx.tcx.hir().local_def_id_from_hir_id(self.id),
+ def_id: cx.tcx.hir().local_def_id(self.id),
inner: ProcMacroItem(ProcMacro {
kind: self.kind,
helpers: self.helpers.clean(cx),