Rust 108 🦀 Mid-Level Intermediate Representation (MIR) Analysis and Borrow Checker Mechanics
The borrow checker does not run on the HIR. It runs on the MIR, a representation that is small enough, explicit enough, and control-flow-based enough to make the borrow checker’s analysis tractable. The MIR is the compiler’s last representation before code generation, and the borrow checker’s phases—dataflow, region inference, and the final error walk—operate on…