fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// MIR for `main` after SimplifyCfg-elaborate-drops 2 3fn main() -> () { 4 let mut _0: (); 5 let mut _1: [u32; 3]; 6 let mut _4: &mut usize; 7 let mut _5: u32; 8 let mut _6: *mut usize; 9 let _7: usize; 10 let mut _8: usize; 11 let mut _9: bool; 12 scope 1 { 13 debug x => _1; 14 let mut _2: usize; 15 scope 2 { 16 debug y => _2; 17 let _3: *mut usize; 18 scope 3 { 19 debug z => _3; 20 scope 4 { 21 } 22 } 23 } 24 } 25 26 bb0: { 27 StorageLive(_1); 28 _1 = [const 42_u32, const 43_u32, const 44_u32]; 29 StorageLive(_2); 30 _2 = const 1_usize; 31 StorageLive(_3); 32 StorageLive(_4); 33 _4 = &mut _2; 34 _3 = &raw mut (*_4); 35 StorageDead(_4); 36 StorageLive(_5); 37 StorageLive(_6); 38 _6 = _3; 39 _5 = foo(move _6) -> [return: bb1, unwind continue]; 40 } 41 42 bb1: { 43 StorageDead(_6); 44 StorageLive(_7); 45 _7 = _2; 46 _8 = Len(_1); 47 _9 = Lt(_7, _8); 48 assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind continue]; 49 } 50 51 bb2: { 52 _1[_7] = move _5; 53 StorageDead(_5); 54 StorageDead(_7); 55 _0 = const (); 56 StorageDead(_3); 57 StorageDead(_2); 58 StorageDead(_1); 59 return; 60 } 61}