Closed
Description
Right now we user a bread-first/depth-first hybrid tree walk to sequentially assign IDs to nodes. This is super unstable, adding a single node having the potential to invalidate the majority of IDs in the map. Something the rustc folks are considering is hashing (a subset) of a given node and using that hash as the ID instead for their IDs. This produces a lot more stable IDs, we should consider this!
Activity
davidbarsky commentedon May 19, 2025
Zulip discussion, for context: https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Stable-r.20Ast.20IDs/near/519046984.
(I think it was @P1n3appl3 who was explaining hashing nodes to Lukas and I as part of rust-lang/compiler-team#790.)