1
Fork 0

Clarify docs for DUMMY_NODE_ID

This commit is contained in:
Camelid 2021-02-07 19:42:12 -08:00
parent 2af4a01450
commit 0f3e2f68d3

View file

@ -18,9 +18,9 @@ rustc_data_structures::define_id_collections!(NodeMap, NodeSet, NodeId);
/// The [`NodeId`] used to represent the root of the crate. /// The [`NodeId`] used to represent the root of the crate.
pub const CRATE_NODE_ID: NodeId = NodeId::from_u32(0); pub const CRATE_NODE_ID: NodeId = NodeId::from_u32(0);
/// When parsing and doing expansions, we initially give all AST nodes this AST /// When parsing and at the beginning of doing expansions, we initially give all AST nodes
/// [`NodeId`]. Then later, during expansion, we renumber them to have small, /// this dummy AST [`NodeId`]. Then, during a later phase of expansion, we renumber them
/// positive IDs. /// to have small, positive IDs.
pub const DUMMY_NODE_ID: NodeId = NodeId::MAX; pub const DUMMY_NODE_ID: NodeId = NodeId::MAX;
impl NodeId { impl NodeId {