fork/rust
git clone https://git.julia.blue/fork/rust
49cae55760d
1.44.0
1- // MIR for `main` before ConstProp 2+ // MIR for `main` after ConstProp 3 4 fn main() -> () { 5 let mut _0: (); // return place in scope 0 at $DIR/boxes.rs:11:11: 11:11 6 let _1: i32; // in scope 0 at $DIR/boxes.rs:12:9: 12:10 7 let mut _2: i32; // in scope 0 at $DIR/boxes.rs:12:13: 12:22 8 let mut _3: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:12:14: 12:22 9 let mut _4: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:12:14: 12:22 10 scope 1 { 11 debug x => _1; // in scope 1 at $DIR/boxes.rs:12:9: 12:10 12 } 13 14 bb0: { 15 StorageLive(_1); // bb0[0]: scope 0 at $DIR/boxes.rs:12:9: 12:10 16 StorageLive(_2); // bb0[1]: scope 0 at $DIR/boxes.rs:12:13: 12:22 17 StorageLive(_3); // bb0[2]: scope 0 at $DIR/boxes.rs:12:14: 12:22 18 StorageLive(_4); // bb0[3]: scope 0 at $DIR/boxes.rs:12:14: 12:22 19 _4 = Box(i32); // bb0[4]: scope 0 at $DIR/boxes.rs:12:14: 12:22 20 (*_4) = const 42i32; // bb0[5]: scope 0 at $DIR/boxes.rs:12:19: 12:21 21 // ty::Const 22 // + ty: i32 23 // + val: Value(Scalar(0x0000002a)) 24 // mir::Constant 25 // + span: $DIR/boxes.rs:12:19: 12:21 26 // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) } 27 _3 = move _4; // bb0[6]: scope 0 at $DIR/boxes.rs:12:14: 12:22 28 StorageDead(_4); // bb0[7]: scope 0 at $DIR/boxes.rs:12:21: 12:22 29 _2 = (*_3); // bb0[8]: scope 0 at $DIR/boxes.rs:12:13: 12:22 30 _1 = Add(move _2, const 0i32); // bb0[9]: scope 0 at $DIR/boxes.rs:12:13: 12:26 31 // ty::Const 32 // + ty: i32 33 // + val: Value(Scalar(0x00000000)) 34 // mir::Constant 35 // + span: $DIR/boxes.rs:12:25: 12:26 36 // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) } 37 StorageDead(_2); // bb0[10]: scope 0 at $DIR/boxes.rs:12:25: 12:26 38 drop(_3) -> [return: bb2, unwind: bb1]; // bb0[11]: scope 0 at $DIR/boxes.rs:12:26: 12:27 39 } 40 41 bb1 (cleanup): { 42 resume; // bb1[0]: scope 0 at $DIR/boxes.rs:11:1: 13:2 43 } 44 45 bb2: { 46 StorageDead(_3); // bb2[0]: scope 0 at $DIR/boxes.rs:12:26: 12:27 47 _0 = const (); // bb2[1]: scope 0 at $DIR/boxes.rs:11:11: 13:2 48 // ty::Const 49 // + ty: () 50 // + val: Value(Scalar(<ZST>)) 51 // mir::Constant 52 // + span: $DIR/boxes.rs:11:11: 13:2 53 // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) } 54 StorageDead(_1); // bb2[2]: scope 0 at $DIR/boxes.rs:13:1: 13:2 55 return; // bb2[3]: scope 0 at $DIR/boxes.rs:13:2: 13:2 56 } 57 } 58