Skip to content

Commit c36e0c0

Browse files
Remove NodeId from doctree::Module
1 parent 4beb751 commit c36e0c0

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

src/librustdoc/clean/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -654,9 +654,9 @@ impl Clean<Item> for doctree::Module<'_> {
654654
attrs,
655655
source: whence.clean(cx),
656656
visibility: self.vis.clean(cx),
657-
stability: cx.stability(self.hid).clean(cx),
658-
deprecation: cx.deprecation(self.hid).clean(cx),
659-
def_id: cx.tcx.hir().local_def_id_from_node_id(self.id),
657+
stability: cx.stability(self.id).clean(cx),
658+
deprecation: cx.deprecation(self.id).clean(cx),
659+
def_id: cx.tcx.hir().local_def_id(self.id),
660660
inner: ModuleItem(Module {
661661
is_crate: self.is_crate,
662662
items,

src/librustdoc/doctree.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pub use self::StructType::*;
44

55
use syntax::ast;
6-
use syntax::ast::{Name, NodeId};
6+
use syntax::ast::Name;
77
use syntax::ext::base::MacroKind;
88
use syntax_pos::{self, Span};
99

@@ -23,8 +23,7 @@ pub struct Module<'hir> {
2323
pub enums: Vec<Enum<'hir>>,
2424
pub fns: Vec<Function<'hir>>,
2525
pub mods: Vec<Module<'hir>>,
26-
pub id: NodeId,
27-
pub hid: hir::HirId,
26+
pub id: hir::HirId,
2827
pub typedefs: Vec<Typedef<'hir>>,
2928
pub opaque_tys: Vec<OpaqueTy<'hir>>,
3029
pub statics: Vec<Static<'hir>>,
@@ -47,8 +46,7 @@ impl Module<'hir> {
4746
) -> Module<'hir> {
4847
Module {
4948
name : name,
50-
id: ast::CRATE_NODE_ID,
51-
hid: hir::CRATE_HIR_ID,
49+
id: hir::CRATE_HIR_ID,
5250
vis,
5351
where_outer: syntax_pos::DUMMY_SP,
5452
where_inner: syntax_pos::DUMMY_SP,

src/librustdoc/visit_ast.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
206206
let mut om = Module::new(name, attrs, vis);
207207
om.where_outer = span;
208208
om.where_inner = m.inner;
209-
om.hid = id;
210-
om.id = self.cx.tcx.hir().hir_to_node_id(id);
209+
om.id = id;
211210
// Keep track of if there were any private modules in the path.
212211
let orig_inside_public_path = self.inside_public_path;
213212
self.inside_public_path &= vis.node.is_pub();

0 commit comments

Comments
 (0)