This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -2,19 +2,25 @@ use rustc_span::ExpnId;
22use std:: fmt;
33
44rustc_index:: newtype_index! {
5+ /// Identifies an AST node.
6+ ///
7+ /// This identifies top-level definitions, expressions, and everything in between.
8+ /// This is later turned into [`DefId`] and `HirId` for the HIR.
9+ ///
10+ /// [`DefId`]: rustc_span::def_id::DefId
511 pub struct NodeId {
612 DEBUG_FORMAT = "NodeId({})"
713 }
814}
915
1016rustc_data_structures:: define_id_collections!( NodeMap , NodeSet , NodeId ) ;
1117
12- /// `NodeId` used to represent the root of the crate.
18+ /// The [ `NodeId`] used to represent the root of the crate.
1319pub const CRATE_NODE_ID : NodeId = NodeId :: from_u32 ( 0 ) ;
1420
15- /// When parsing and doing expansions, we initially give all AST nodes this AST
16- /// node value . Then later , during expansion, we renumber them to have small,
17- /// positive ids .
21+ /// When parsing and at the beginning of doing expansions, we initially give all AST nodes
22+ /// this dummy AST [`NodeId`] . Then, during a later phase of expansion, we renumber them
23+ /// to have small, positive IDs .
1824pub const DUMMY_NODE_ID : NodeId = NodeId :: MAX ;
1925
2026impl NodeId {
You can’t perform that action at this time.
0 commit comments