fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// MIR for `foo` after built 2 3fn foo(_1: Box<[T]>) -> T { 4 debug it => _1; 5 let mut _0: T; 6 let _2: T; 7 let mut _3: &T; 8 let _4: usize; 9 let mut _5: usize; 10 let mut _6: bool; 11 scope 1 { 12 debug f => _2; 13 } 14 15 bb0: { 16 StorageLive(_2); 17 StorageLive(_3); 18 StorageLive(_4); 19 _4 = const 0_usize; 20 _5 = Len((*_1)); 21 _6 = Lt(_4, _5); 22 assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind: bb5]; 23 } 24 25 bb1: { 26 _3 = &(*_1)[_4]; 27 _2 = <T as Clone>::clone(move _3) -> [return: bb2, unwind: bb5]; 28 } 29 30 bb2: { 31 StorageDead(_3); 32 FakeRead(ForLet(None), _2); 33 StorageDead(_4); 34 _0 = move _2; 35 drop(_2) -> [return: bb3, unwind: bb5]; 36 } 37 38 bb3: { 39 StorageDead(_2); 40 drop(_1) -> [return: bb4, unwind: bb6]; 41 } 42 43 bb4: { 44 return; 45 } 46 47 bb5 (cleanup): { 48 drop(_1) -> [return: bb6, unwind terminate(cleanup)]; 49 } 50 51 bb6 (cleanup): { 52 resume; 53 } 54}