Mutation/Creation of HIR
Rust Internals [Unofficial]
May 4, 2026
> Since directly mutating the HIR did not work well, the rewrites were kept at the AST level. Whenever additional information was needed, the AST was lowered to HIR to obtain it.
How were you able to map the information found on the HIR back to the AST to perform your modifications based on it? I am currently using spans but I am not sure if this approach is reliable. Some insight on this would be very helpful. Thank you both.
Discussion in the ATmosphere