fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1- // MIR for `main` before ConstProp 2+ // MIR for `main` after ConstProp 3 4 fn main() -> () { 5 let mut _0: (); 6 let _1: u32; 7 let mut _2: [u32; 4]; 8 let _3: usize; 9 let mut _4: usize; 10 let mut _5: bool; 11 scope 1 { 12 debug x => _1; 13 } 14 15 bb0: { 16 StorageLive(_1); 17 StorageLive(_2); 18 _2 = [const 0_u32, const 1_u32, const 2_u32, const 3_u32]; 19 StorageLive(_3); 20 _3 = const 2_usize; 21- _4 = Len(_2); 22- _5 = Lt(_3, _4); 23- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; 24+ _4 = const 4_usize; 25+ _5 = const true; 26+ assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind continue]; 27 } 28 29 bb1: { 30- _1 = _2[_3]; 31+ _1 = const 2_u32; 32 StorageDead(_3); 33 StorageDead(_2); 34 _0 = const (); 35 StorageDead(_1); 36 return; 37 } 38 } 39