File tree 1 file changed +10
-4
lines changed
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;
2
2
use std:: fmt;
3
3
4
4
rustc_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
5
11
pub struct NodeId {
6
12
DEBUG_FORMAT = "NodeId({})"
7
13
}
8
14
}
9
15
10
16
rustc_data_structures:: define_id_collections!( NodeMap , NodeSet , NodeId ) ;
11
17
12
- /// `NodeId` used to represent the root of the crate.
18
+ /// The [ `NodeId`] used to represent the root of the crate.
13
19
pub const CRATE_NODE_ID : NodeId = NodeId :: from_u32 ( 0 ) ;
14
20
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 .
18
24
pub const DUMMY_NODE_ID : NodeId = NodeId :: MAX ;
19
25
20
26
impl NodeId {
You can’t perform that action at this time.
0 commit comments