fn foo(x: i32, y: i32) -> i32 {
x * x + y * y
}
fn foo(_1: i32, _2: i32) -> i32 {
let mut _0: i32; // return place
let mut _3: i32;
let mut _4: i32;
let mut _5: i32;
let mut _6: i32;
let mut _7: i32;
let mut _8: i32;
bb0: {
StorageLive(_3); // bb0[0]: scope 0 at test.rs:4:5: 4:10
StorageLive(_4); // bb0[1]: scope 0 at test.rs:4:5: 4:6
_4 = _1; // bb0[2]: scope 0 at test.rs:4:5: 4:6
StorageLive(_5); // bb0[3]: scope 0 at test.rs:4:9: 4:10
_5 = _1; // bb0[4]: scope 0 at test.rs:4:9: 4:10
_3 = Mul(move _4, move _5); // bb0[5]: scope 0 at test.rs:4:5: 4:10
StorageDead(_5); // bb0[6]: scope 0 at test.rs:4:10: 4:10
StorageDead(_4); // bb0[7]: scope 0 at test.rs:4:10: 4:10
StorageLive(_6); // bb0[8]: scope 0 at test.rs:4:13: 4:18
StorageLive(_7); // bb0[9]: scope 0 at test.rs:4:13: 4:14
_7 = _2; // bb0[10]: scope 0 at test.rs:4:13: 4:14
StorageLive(_8); // bb0[11]: scope 0 at test.rs:4:17: 4:18
_8 = _2; // bb0[12]: scope 0 at test.rs:4:17: 4:18
_6 = Mul(move _7, move _8); // bb0[13]: scope 0 at test.rs:4:13: 4:18
StorageDead(_8); // bb0[14]: scope 0 at test.rs:4:18: 4:18
StorageDead(_7); // bb0[15]: scope 0 at test.rs:4:18: 4:18
_0 = Add(move _3, move _6); // bb0[16]: scope 0 at test.rs:4:5: 4:18
StorageDead(_6); // bb0[17]: scope 0 at test.rs:4:18: 4:18
StorageDead(_3); // bb0[18]: scope 0 at test.rs:4:18: 4:18
return; // bb0[19]: scope 0 at test.rs:5:2: 5:2
}
fn foo(x: i32, y: i32) -> i32 {
x * x + y * y
}
fn foo(_1: i32, _2: i32) -> i32 {
let mut _0: i32; // return place
let mut _3: i32;
let mut _4: i32;
let mut _5: i32;
let mut _6: i32;
let mut _7: i32;
let mut _8: i32;
bb0: {
StorageLive(_3); // bb0[0]: scope 0 at test.rs:4:5: 4:10
StorageLive(_4); // bb0[1]: scope 0 at test.rs:4:5: 4:6
_4 = _1; // bb0[2]: scope 0 at test.rs:4:5: 4:6
StorageLive(_5); // bb0[3]: scope 0 at test.rs:4:9: 4:10
_5 = _1; // bb0[4]: scope 0 at test.rs:4:9: 4:10
_3 = Mul(move _4, move _5); // bb0[5]: scope 0 at test.rs:4:5: 4:10
StorageDead(_5); // bb0[6]: scope 0 at test.rs:4:10: 4:10
StorageDead(_4); // bb0[7]: scope 0 at test.rs:4:10: 4:10
StorageLive(_6); // bb0[8]: scope 0 at test.rs:4:13: 4:18
StorageLive(_7); // bb0[9]: scope 0 at test.rs:4:13: 4:14
_7 = _2; // bb0[10]: scope 0 at test.rs:4:13: 4:14
StorageLive(_8); // bb0[11]: scope 0 at test.rs:4:17: 4:18
_8 = _2; // bb0[12]: scope 0 at test.rs:4:17: 4:18
_6 = Mul(move _7, move _8); // bb0[13]: scope 0 at test.rs:4:13: 4:18
StorageDead(_8); // bb0[14]: scope 0 at test.rs:4:18: 4:18
StorageDead(_7); // bb0[15]: scope 0 at test.rs:4:18: 4:18
_0 = Add(move _3, move _6); // bb0[16]: scope 0 at test.rs:4:5: 4:18
StorageDead(_6); // bb0[17]: scope 0 at test.rs:4:18: 4:18
StorageDead(_3); // bb0[18]: scope 0 at test.rs:4:18: 4:18
return; // bb0[19]: scope 0 at test.rs:5:2: 5:2
}
}
MIRの概要
ドライバの作成