fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1- // MIR for `main` before DataflowConstProp 2+ // MIR for `main` after DataflowConstProp 3 4 fn main() -> () { 5 let mut _0: (); 6 let _1: u32; 7 let mut _2: &[u32]; 8 let mut _3: &[u32; 3]; 9 let _4: &[u32; 3]; 10 let _5: [u32; 3]; 11 let _6: usize; 12 let mut _7: usize; 13 let mut _8: bool; 14 let mut _10: &[u32]; 15 let _11: usize; 16 let mut _12: usize; 17 let mut _13: bool; 18 let mut _14: &[u32; 3]; 19 scope 1 { 20 debug local => _1; 21 let _9: u32; 22 scope 2 { 23 debug constant => _9; 24 } 25 } 26 27 bb0: { 28 StorageLive(_1); 29 StorageLive(_2); 30 StorageLive(_3); 31 StorageLive(_4); 32 _14 = const _; 33 _4 = _14; 34 _3 = _4; 35 _2 = move _3 as &[u32] (PointerCoercion(Unsize)); 36 StorageDead(_3); 37 StorageLive(_6); 38 _6 = const 1_usize; 39- _7 = Len((*_2)); 40- _8 = Lt(_6, _7); 41- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue]; 42+ _7 = const 3_usize; 43+ _8 = const true; 44+ assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind continue]; 45 } 46 47 bb1: { 48- _1 = (*_2)[_6]; 49+ _1 = (*_2)[1 of 2]; 50 StorageDead(_6); 51 StorageDead(_4); 52 StorageDead(_2); 53 StorageLive(_9); 54 StorageLive(_10); 55 _10 = const _; 56 StorageLive(_11); 57 _11 = const 1_usize; 58- _12 = Len((*_10)); 59- _13 = Lt(_11, _12); 60- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb2, unwind continue]; 61+ _12 = const 3_usize; 62+ _13 = const true; 63+ assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb2, unwind continue]; 64 } 65 66 bb2: { 67- _9 = (*_10)[_11]; 68+ _9 = (*_10)[1 of 2]; 69 StorageDead(_11); 70 StorageDead(_10); 71 _0 = const (); 72 StorageDead(_9); 73 StorageDead(_1); 74 return; 75 } 76 } 77