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/repeat.rs:5:11: 5:11 6 let _1: u32 as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/repeat.rs:6:9: 6:10 7 let mut _2: u32; // in scope 0 at $DIR/repeat.rs:6:18: 6:28 8 let mut _3: [u32; 8]; // in scope 0 at $DIR/repeat.rs:6:18: 6:25 9 let _4: usize; // in scope 0 at $DIR/repeat.rs:6:26: 6:27 10 let mut _5: usize; // in scope 0 at $DIR/repeat.rs:6:18: 6:28 11 let mut _6: bool; // in scope 0 at $DIR/repeat.rs:6:18: 6:28 12 scope 1 { 13 debug x => _1; // in scope 1 at $DIR/repeat.rs:6:9: 6:10 14 } 15 16 bb0: { 17 StorageLive(_1); // bb0[0]: scope 0 at $DIR/repeat.rs:6:9: 6:10 18 StorageLive(_2); // bb0[1]: scope 0 at $DIR/repeat.rs:6:18: 6:28 19 StorageLive(_3); // bb0[2]: scope 0 at $DIR/repeat.rs:6:18: 6:25 20 _3 = [const 42u32; 8]; // bb0[3]: scope 0 at $DIR/repeat.rs:6:18: 6:25 21 // ty::Const 22 // + ty: u32 23 // + val: Value(Scalar(0x0000002a)) 24 // mir::Constant 25 // + span: $DIR/repeat.rs:6:19: 6:21 26 // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) } 27 StorageLive(_4); // bb0[4]: scope 0 at $DIR/repeat.rs:6:26: 6:27 28 _4 = const 2usize; // bb0[5]: scope 0 at $DIR/repeat.rs:6:26: 6:27 29 // ty::Const 30 // + ty: usize 31 // + val: Value(Scalar(0x0000000000000002)) 32 // mir::Constant 33 // + span: $DIR/repeat.rs:6:26: 6:27 34 // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) } 35 _5 = const 8usize; // bb0[6]: scope 0 at $DIR/repeat.rs:6:18: 6:28 36 // ty::Const 37 // + ty: usize 38 // + val: Value(Scalar(0x0000000000000008)) 39 // mir::Constant 40 // + span: $DIR/repeat.rs:6:18: 6:28 41 // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000008)) } 42- _6 = Lt(_4, _5); // bb0[7]: scope 0 at $DIR/repeat.rs:6:18: 6:28 43- assert(move _6, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // bb0[8]: scope 0 at $DIR/repeat.rs:6:18: 6:28 44+ _6 = const true; // bb0[7]: scope 0 at $DIR/repeat.rs:6:18: 6:28 45+ // ty::Const 46+ // + ty: bool 47+ // + val: Value(Scalar(0x01)) 48+ // mir::Constant 49+ // + span: $DIR/repeat.rs:6:18: 6:28 50+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) } 51+ assert(const true, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // bb0[8]: scope 0 at $DIR/repeat.rs:6:18: 6:28 52+ // ty::Const 53+ // + ty: bool 54+ // + val: Value(Scalar(0x01)) 55+ // mir::Constant 56+ // + span: $DIR/repeat.rs:6:18: 6:28 57+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) } 58 } 59 60 bb1: { 61- _2 = _3[_4]; // bb1[0]: scope 0 at $DIR/repeat.rs:6:18: 6:28 62- _1 = Add(move _2, const 0u32); // bb1[1]: scope 0 at $DIR/repeat.rs:6:18: 6:32 63+ _2 = const 42u32; // bb1[0]: scope 0 at $DIR/repeat.rs:6:18: 6:28 64 // ty::Const 65 // + ty: u32 66- // + val: Value(Scalar(0x00000000)) 67+ // + val: Value(Scalar(0x0000002a)) 68 // mir::Constant 69- // + span: $DIR/repeat.rs:6:31: 6:32 70- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) } 71+ // + span: $DIR/repeat.rs:6:18: 6:28 72+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) } 73+ _1 = const 42u32; // bb1[1]: scope 0 at $DIR/repeat.rs:6:18: 6:32 74+ // ty::Const 75+ // + ty: u32 76+ // + val: Value(Scalar(0x0000002a)) 77+ // mir::Constant 78+ // + span: $DIR/repeat.rs:6:18: 6:32 79+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) } 80 StorageDead(_2); // bb1[2]: scope 0 at $DIR/repeat.rs:6:31: 6:32 81 StorageDead(_4); // bb1[3]: scope 0 at $DIR/repeat.rs:6:32: 6:33 82 StorageDead(_3); // bb1[4]: scope 0 at $DIR/repeat.rs:6:32: 6:33 83 _0 = const (); // bb1[5]: scope 0 at $DIR/repeat.rs:5:11: 7:2 84 // ty::Const 85 // + ty: () 86 // + val: Value(Scalar(<ZST>)) 87 // mir::Constant 88 // + span: $DIR/repeat.rs:5:11: 7:2 89 // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) } 90 StorageDead(_1); // bb1[6]: scope 0 at $DIR/repeat.rs:7:1: 7:2 91 return; // bb1[7]: scope 0 at $DIR/repeat.rs:7:2: 7:2 92 } 93 } 94