Description
HirId
s were introduced in bc259ee (March 2017) as a replacement for ast::NodeId
s after HIR lowering; this is said to be good for incremental compilation. The commentary for pull request #43740 (August 2017) says:
In the future the
HirId
should completely replace theNodeId
in HIR nodes. [...] Ideally we convert more and more code fromNodeId
toHirId
in the future so that there are no moreNodeId
s after HIR lowering anywhere.
The HIR chapter of the rustc development guide similarly says "while [NodeId
s] are still in common use, they are being slowly phased out" (emphasis in original).
However, a drawback of the "gradually migrate over to the new way of doing things in the course of addressing other issues" strategy is that it's all too easy for the codebase to remain in a transitional state indefinitely. Thus, perhaps we should have this dedicated issue to track progress towards not using NodeId
s after HIR lowering.