Rust intermediate files


Here is standard

fn main() {
    println!("Hello, world!");

Intermediate: hello_world-mir
I wonder why is four variables _0, _1, _2,_3 in static main and eight in fn main()


As a starting-point println! is a macro and thus your code expands to this:

use std::prelude::v1::*;
extern crate std as std;
fn main() {
                static __STATIC_FMTSTR: &'static [&'static str] = &["Hello, world!\n"];
            &match () {
                () => [],

Not a direct answer to your question but a bit closer to the actual code that ends up being turned into MIR.