Skip to content

Commit 5b16a66

Browse files
authored
Rollup merge of rust-lang#78795 - est31:node_id_assignment_doc_fix, r=oli-obk
The renumber pass is long gone Originally, there has been a dedicated pass for renumbering AST NodeIds to have actual values. This pass had been added by commit a5ad4c3. Then, later, this step was moved to where it resides now, macro expansion. See commit c86c8d4 or PR rust-lang#36438. The comment snippet, added by the original commit, has survived the times without any change, becoming outdated at removal of the dedicated pass. Nowadays, grepping for the next_node_id function will show up multiple places in the compiler that call it, but the main rewriting that the comment talks about is still done in the expansion step, inside an innocious looking visit_id function that's called during macro invocation collection.
2 parents 09a40af + dfa5e46 commit 5b16a66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_ast/src/node_id.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ rustc_data_structures::define_id_collections!(NodeMap, NodeSet, NodeId);
1313
pub const CRATE_NODE_ID: NodeId = NodeId::from_u32(0);
1414

1515
/// When parsing and doing expansions, we initially give all AST nodes this AST
16-
/// node value. Then later, in the renumber pass, we renumber them to have
17-
/// small, positive ids.
16+
/// node value. Then later, during expansion, we renumber them to have small,
17+
/// positive ids.
1818
pub const DUMMY_NODE_ID: NodeId = NodeId::MAX;
1919

2020
impl NodeId {

0 commit comments

Comments
 (0)