Remove NodeId from doctree::Module
This commit is contained in:
parent
4beb751575
commit
c36e0c0424
3 changed files with 7 additions and 10 deletions
|
@ -654,9 +654,9 @@ impl Clean<Item> for doctree::Module<'_> {
|
||||||
attrs,
|
attrs,
|
||||||
source: whence.clean(cx),
|
source: whence.clean(cx),
|
||||||
visibility: self.vis.clean(cx),
|
visibility: self.vis.clean(cx),
|
||||||
stability: cx.stability(self.hid).clean(cx),
|
stability: cx.stability(self.id).clean(cx),
|
||||||
deprecation: cx.deprecation(self.hid).clean(cx),
|
deprecation: cx.deprecation(self.id).clean(cx),
|
||||||
def_id: cx.tcx.hir().local_def_id_from_node_id(self.id),
|
def_id: cx.tcx.hir().local_def_id(self.id),
|
||||||
inner: ModuleItem(Module {
|
inner: ModuleItem(Module {
|
||||||
is_crate: self.is_crate,
|
is_crate: self.is_crate,
|
||||||
items,
|
items,
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
pub use self::StructType::*;
|
pub use self::StructType::*;
|
||||||
|
|
||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
use syntax::ast::{Name, NodeId};
|
use syntax::ast::Name;
|
||||||
use syntax::ext::base::MacroKind;
|
use syntax::ext::base::MacroKind;
|
||||||
use syntax_pos::{self, Span};
|
use syntax_pos::{self, Span};
|
||||||
|
|
||||||
|
@ -23,8 +23,7 @@ pub struct Module<'hir> {
|
||||||
pub enums: Vec<Enum<'hir>>,
|
pub enums: Vec<Enum<'hir>>,
|
||||||
pub fns: Vec<Function<'hir>>,
|
pub fns: Vec<Function<'hir>>,
|
||||||
pub mods: Vec<Module<'hir>>,
|
pub mods: Vec<Module<'hir>>,
|
||||||
pub id: NodeId,
|
pub id: hir::HirId,
|
||||||
pub hid: hir::HirId,
|
|
||||||
pub typedefs: Vec<Typedef<'hir>>,
|
pub typedefs: Vec<Typedef<'hir>>,
|
||||||
pub opaque_tys: Vec<OpaqueTy<'hir>>,
|
pub opaque_tys: Vec<OpaqueTy<'hir>>,
|
||||||
pub statics: Vec<Static<'hir>>,
|
pub statics: Vec<Static<'hir>>,
|
||||||
|
@ -47,8 +46,7 @@ impl Module<'hir> {
|
||||||
) -> Module<'hir> {
|
) -> Module<'hir> {
|
||||||
Module {
|
Module {
|
||||||
name : name,
|
name : name,
|
||||||
id: ast::CRATE_NODE_ID,
|
id: hir::CRATE_HIR_ID,
|
||||||
hid: hir::CRATE_HIR_ID,
|
|
||||||
vis,
|
vis,
|
||||||
where_outer: syntax_pos::DUMMY_SP,
|
where_outer: syntax_pos::DUMMY_SP,
|
||||||
where_inner: syntax_pos::DUMMY_SP,
|
where_inner: syntax_pos::DUMMY_SP,
|
||||||
|
|
|
@ -206,8 +206,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
|
||||||
let mut om = Module::new(name, attrs, vis);
|
let mut om = Module::new(name, attrs, vis);
|
||||||
om.where_outer = span;
|
om.where_outer = span;
|
||||||
om.where_inner = m.inner;
|
om.where_inner = m.inner;
|
||||||
om.hid = id;
|
om.id = id;
|
||||||
om.id = self.cx.tcx.hir().hir_to_node_id(id);
|
|
||||||
// Keep track of if there were any private modules in the path.
|
// Keep track of if there were any private modules in the path.
|
||||||
let orig_inside_public_path = self.inside_public_path;
|
let orig_inside_public_path = self.inside_public_path;
|
||||||
self.inside_public_path &= vis.node.is_pub();
|
self.inside_public_path &= vis.node.is_pub();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue