fork/rust
git clone https://git.julia.blue/fork/rust
49cae55760d
1.44.0
1- // MIR for `hello` before ConstProp 2+ // MIR for `hello` after ConstProp 3 4 fn hello() -> () { 5 let mut _0: (); // return place in scope 0 at $DIR/control-flow-simplification.rs:11:14: 11:14 6 let mut _1: bool; // in scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 7 let mut _2: !; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL 8 9 bb0: { 10 StorageLive(_1); // bb0[0]: scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 11- _1 = const <bool as NeedsDrop>::NEEDS; // bb0[1]: scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 12+ _1 = const false; // bb0[1]: scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 13 // ty::Const 14 // + ty: bool 15- // + val: Unevaluated(DefId(0:4 ~ control_flow_simplification[317d]::NeedsDrop[0]::NEEDS[0]), [bool], None) 16+ // + val: Value(Scalar(0x00)) 17 // mir::Constant 18 // + span: $DIR/control-flow-simplification.rs:12:8: 12:21 19- // + literal: Const { ty: bool, val: Unevaluated(DefId(0:4 ~ control_flow_simplification[317d]::NeedsDrop[0]::NEEDS[0]), [bool], None) } 20- switchInt(_1) -> [false: bb1, otherwise: bb2]; // bb0[2]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6 21+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) } 22+ switchInt(const false) -> [false: bb1, otherwise: bb2]; // bb0[2]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6 23+ // ty::Const 24+ // + ty: bool 25+ // + val: Value(Scalar(0x00)) 26+ // mir::Constant 27+ // + span: $DIR/control-flow-simplification.rs:12:5: 14:6 28+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) } 29 } 30 31 bb1: { 32 _0 = const (); // bb1[0]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6 33 // ty::Const 34 // + ty: () 35 // + val: Value(Scalar(<ZST>)) 36 // mir::Constant 37 // + span: $DIR/control-flow-simplification.rs:12:5: 14:6 38 // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) } 39 StorageDead(_1); // bb1[1]: scope 0 at $DIR/control-flow-simplification.rs:15:1: 15:2 40 return; // bb1[2]: scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2 41 } 42 43 bb2: { 44 StorageLive(_2); // bb2[0]: scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL 45 const std::rt::begin_panic::<&str>(const "explicit panic"); // bb2[1]: scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL 46 // ty::Const 47 // + ty: fn(&str) -> ! {std::rt::begin_panic::<&str>} 48 // + val: Value(Scalar(<ZST>)) 49 // mir::Constant 50 // + span: $SRC_DIR/libstd/macros.rs:LL:COL 51 // + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar(<ZST>)) } 52 // ty::Const 53 // + ty: &str 54 // + val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [16383], len: Size { raw: 14 } }, size: Size { raw: 14 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) 55 // mir::Constant 56 // + span: $SRC_DIR/libstd/macros.rs:LL:COL 57 // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [16383], len: Size { raw: 14 } }, size: Size { raw: 14 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) } 58 } 59 } 60