fork/rust
git clone https://git.julia.blue/fork/rust
49cae55760d
1.44.0
1- // MIR for `main` before SimplifyArmIdentity 2+ // MIR for `main` after SimplifyArmIdentity 3 4 fn main() -> () { 5 let mut _0: (); // return place in scope 0 at $DIR/simplify-arm-identity.rs:16:11: 16:11 6 let _1: Src as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/simplify-arm-identity.rs:17:9: 17:10 7 let mut _2: Dst; // in scope 0 at $DIR/simplify-arm-identity.rs:18:18: 21:6 8 let mut _3: isize; // in scope 0 at $DIR/simplify-arm-identity.rs:19:9: 19:20 9 let mut _5: u8; // in scope 0 at $DIR/simplify-arm-identity.rs:19:33: 19:34 10 scope 1 { 11 debug e => _1; // in scope 1 at $DIR/simplify-arm-identity.rs:17:9: 17:10 12 let _4: u8; // in scope 1 at $DIR/simplify-arm-identity.rs:19:18: 19:19 13 scope 2 { 14 } 15 scope 3 { 16 debug x => _4; // in scope 3 at $DIR/simplify-arm-identity.rs:19:18: 19:19 17 } 18 } 19 20 bb0: { 21 StorageLive(_1); // bb0[0]: scope 0 at $DIR/simplify-arm-identity.rs:17:9: 17:10 22 ((_1 as Foo).0: u8) = const 0u8; // bb0[1]: scope 0 at $DIR/simplify-arm-identity.rs:17:18: 17:29 23 // ty::Const 24 // + ty: u8 25 // + val: Value(Scalar(0x00)) 26 // mir::Constant 27 // + span: $DIR/simplify-arm-identity.rs:17:27: 17:28 28 // + literal: Const { ty: u8, val: Value(Scalar(0x00)) } 29 discriminant(_1) = 0; // bb0[2]: scope 0 at $DIR/simplify-arm-identity.rs:17:18: 17:29 30 StorageLive(_2); // bb0[3]: scope 1 at $DIR/simplify-arm-identity.rs:18:18: 21:6 31 _3 = discriminant(_1); // bb0[4]: scope 1 at $DIR/simplify-arm-identity.rs:19:9: 19:20 32 switchInt(move _3) -> [0isize: bb3, 1isize: bb1, otherwise: bb2]; // bb0[5]: scope 1 at $DIR/simplify-arm-identity.rs:19:9: 19:20 33 } 34 35 bb1: { 36 ((_2 as Foo).0: u8) = const 0u8; // bb1[0]: scope 1 at $DIR/simplify-arm-identity.rs:20:21: 20:32 37 // ty::Const 38 // + ty: u8 39 // + val: Value(Scalar(0x00)) 40 // mir::Constant 41 // + span: $DIR/simplify-arm-identity.rs:20:30: 20:31 42 // + literal: Const { ty: u8, val: Value(Scalar(0x00)) } 43 discriminant(_2) = 0; // bb1[1]: scope 1 at $DIR/simplify-arm-identity.rs:20:21: 20:32 44 goto -> bb4; // bb1[2]: scope 1 at $DIR/simplify-arm-identity.rs:18:18: 21:6 45 } 46 47 bb2: { 48 unreachable; // bb2[0]: scope 1 at $DIR/simplify-arm-identity.rs:18:24: 18:25 49 } 50 51 bb3: { 52 _4 = ((_1 as Foo).0: u8); // bb3[0]: scope 1 at $DIR/simplify-arm-identity.rs:19:18: 19:19 53 ((_2 as Foo).0: u8) = move _4; // bb3[1]: scope 3 at $DIR/simplify-arm-identity.rs:19:24: 19:35 54 discriminant(_2) = 0; // bb3[2]: scope 3 at $DIR/simplify-arm-identity.rs:19:24: 19:35 55 goto -> bb4; // bb3[3]: scope 1 at $DIR/simplify-arm-identity.rs:18:18: 21:6 56 } 57 58 bb4: { 59 StorageDead(_2); // bb4[0]: scope 1 at $DIR/simplify-arm-identity.rs:21:6: 21:7 60 _0 = const (); // bb4[1]: scope 0 at $DIR/simplify-arm-identity.rs:16:11: 22:2 61 // ty::Const 62 // + ty: () 63 // + val: Value(Scalar(<ZST>)) 64 // mir::Constant 65 // + span: $DIR/simplify-arm-identity.rs:16:11: 22:2 66 // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) } 67 StorageDead(_1); // bb4[2]: scope 0 at $DIR/simplify-arm-identity.rs:22:1: 22:2 68 return; // bb4[3]: scope 0 at $DIR/simplify-arm-identity.rs:22:2: 22:2 69 } 70 } 71