提交 4b7e44f8 编写于 作者: M marmeladema

rustdoc: remove calls to `local_def_id_from_node_id`

上级 91fb72a8
......@@ -6,7 +6,7 @@
use rustc_data_structures::fx::FxHashSet;
use rustc_hir as hir;
use rustc_hir::def::{CtorKind, DefKind, Res};
use rustc_hir::def_id::DefId;
use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX};
use rustc_hir::Mutability;
use rustc_metadata::creader::LoadedMacro;
use rustc_middle::ty;
......@@ -454,11 +454,7 @@ fn fill_in(
name: None,
attrs: clean::Attributes::default(),
source: clean::Span::empty(),
def_id: cx
.tcx
.hir()
.local_def_id_from_node_id(ast::CRATE_NODE_ID)
.to_def_id(),
def_id: DefId::local(CRATE_DEF_INDEX),
visibility: clean::Public,
stability: None,
deprecation: None,
......
......@@ -1549,11 +1549,11 @@ fn clean(&self, cx: &DocContext<'_>) -> Type {
ty::FnDef(..) | 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);
let def_id = DefId::local(CRATE_DEF_INDEX);
BareFunction(box BareFunctionDecl {
unsafety: sig.unsafety(),
generic_params: Vec::new(),
decl: (local_def_id.to_def_id(), sig).clean(cx),
decl: (def_id, sig).clean(cx),
abi: sig.abi(),
})
}
......@@ -2255,7 +2255,7 @@ fn clean(&self, cx: &DocContext<'_>) -> Vec<Item> {
name: None,
attrs: self.attrs.clean(cx),
source: self.whence.clean(cx),
def_id: cx.tcx.hir().local_def_id_from_node_id(ast::CRATE_NODE_ID).to_def_id(),
def_id: DefId::local(CRATE_DEF_INDEX),
visibility: self.vis.clean(cx),
stability: None,
deprecation: None,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册