Rust MIR ; :
fn main() {
let foo = &String::new();
}
MIR, ( ):
fn main() -> () {
let mut _0: ();
scope 1 {
let _1: &std::string::String;
}
scope 2 {
}
let mut _2: std::string::String;
bb0: {
StorageLive(_1);
StorageLive(_2);
_2 = const std::string::String::new() -> bb1;
}
bb1: {
_1 = &_2;
_0 = ();
StorageDead(_1);
drop(_2) -> bb2;
}
bb2: {
StorageDead(_2);
return;
}
}
, "" , , , .
, , -, scope 2 - ; , MIR 100%.