Mutation/Creation of HIR
Rust Internals [Unofficial]
May 4, 2026
In this case, rewriting the source program was required, so MIR was not a suitable option, as its output does not resemble the original.
While it's clear that rustc is not designed for rewriting tools -- something that becomes apparent when building one -- I'm curious about the use of rust-analyzer in this context. Can it provide precise type information, or is it more of an approximation that may differ from the compiler's? Additionally, when checking whether a program compiles, is that effectively the ground truth, or may it differ from the compiler?
Thanks in advance!
Discussion in the ATmosphere