// MIR for `enumerated_loop` after PreCodegen fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { debug slice => _1; debug f => _2; let mut _0: (); let mut _13: std::slice::Iter<'_, T>; let mut _14: std::iter::Enumerate>; let mut _15: std::iter::Enumerate>; let mut _23: std::option::Option<(usize, &T)>; let mut _26: &impl Fn(usize, &T); let mut _27: (usize, &T); let _28: (); scope 1 { debug iter => _15; let _24: usize; let _25: &T; scope 2 { debug i => _24; debug x => _25; } scope 18 (inlined > as Iterator>::next) { let mut _16: &mut std::slice::Iter<'_, T>; let mut _17: std::option::Option<&T>; let mut _21: (usize, bool); let mut _22: (usize, &T); scope 19 { let _20: usize; scope 24 { } } scope 20 { scope 21 { scope 27 (inlined as FromResidual>>::from_residual) { } } } scope 22 { scope 23 { } } scope 25 (inlined as Try>::branch) { let mut _18: isize; let _19: &T; scope 26 { } } } } scope 3 (inlined core::slice::::iter) { scope 4 (inlined std::slice::Iter::<'_, T>::new) { let _3: usize; let mut _5: std::ptr::NonNull<[T]>; let mut _9: *mut T; let mut _10: *mut T; let mut _12: *const T; scope 5 { let _8: std::ptr::NonNull; scope 6 { let _11: *const T; scope 7 { } scope 12 (inlined without_provenance::) { } scope 13 (inlined NonNull::::as_ptr) { } scope 14 (inlined std::ptr::mut_ptr::::add) { } } scope 8 (inlined as From<&[T]>>::from) { scope 9 (inlined NonNull::<[T]>::from_ref) { let mut _4: *const [T]; } } scope 10 (inlined NonNull::<[T]>::cast::) { let mut _6: *mut [T]; let mut _7: *const T; scope 11 (inlined NonNull::<[T]>::as_ptr) { } } } } } scope 15 (inlined as Iterator>::enumerate) { scope 16 (inlined Enumerate::>::new) { } } scope 17 (inlined > as IntoIterator>::into_iter) { } bb0: { StorageLive(_13); StorageLive(_3); StorageLive(_8); _3 = PtrMetadata(copy _1); StorageLive(_5); StorageLive(_4); _4 = &raw const (*_1); _5 = NonNull::<[T]> { pointer: move _4 }; StorageDead(_4); StorageLive(_6); StorageLive(_7); _6 = copy _5 as *mut [T] (Transmute); _7 = copy _6 as *const T (PtrToPtr); _8 = NonNull:: { pointer: move _7 }; StorageDead(_7); StorageDead(_6); StorageDead(_5); StorageLive(_11); switchInt(const ::IS_ZST) -> [0: bb1, otherwise: bb2]; } bb1: { StorageLive(_10); StorageLive(_9); _9 = copy _8 as *mut T (Transmute); _10 = Offset(copy _9, copy _3); StorageDead(_9); _11 = move _10 as *const T (PtrToPtr); StorageDead(_10); goto -> bb3; } bb2: { _11 = copy _3 as *const T (Transmute); goto -> bb3; } bb3: { StorageLive(_12); _12 = copy _11; _13 = std::slice::Iter::<'_, T> { ptr: copy _8, end_or_len: move _12, _marker: const ZeroSized: PhantomData<&T> }; StorageDead(_12); StorageDead(_11); StorageDead(_8); StorageDead(_3); _14 = Enumerate::> { iter: copy _13, count: const 0_usize }; StorageDead(_13); StorageLive(_15); _15 = copy _14; goto -> bb4; } bb4: { StorageLive(_23); StorageLive(_20); StorageLive(_21); StorageLive(_17); StorageLive(_16); _16 = &mut (_15.0: std::slice::Iter<'_, T>); _17 = as Iterator>::next(move _16) -> [return: bb5, unwind unreachable]; } bb5: { StorageDead(_16); StorageLive(_18); _18 = discriminant(_17); switchInt(move _18) -> [0: bb6, 1: bb8, otherwise: bb11]; } bb6: { StorageDead(_18); StorageDead(_17); StorageDead(_21); StorageDead(_20); StorageDead(_23); StorageDead(_15); drop(_2) -> [return: bb7, unwind unreachable]; } bb7: { return; } bb8: { _19 = move ((_17 as Some).0: &T); StorageDead(_18); StorageDead(_17); _20 = copy (_15.1: usize); _21 = AddWithOverflow(copy (_15.1: usize), const 1_usize); assert(!move (_21.1: bool), "attempt to compute `{} + {}`, which would overflow", copy (_15.1: usize), const 1_usize) -> [success: bb9, unwind unreachable]; } bb9: { (_15.1: usize) = move (_21.0: usize); StorageLive(_22); _22 = (copy _20, copy _19); _23 = Option::<(usize, &T)>::Some(move _22); StorageDead(_22); StorageDead(_21); StorageDead(_20); _24 = copy (((_23 as Some).0: (usize, &T)).0: usize); _25 = copy (((_23 as Some).0: (usize, &T)).1: &T); StorageLive(_26); _26 = &_2; StorageLive(_27); _27 = (copy _24, copy _25); _28 = >::call(move _26, move _27) -> [return: bb10, unwind unreachable]; } bb10: { StorageDead(_27); StorageDead(_26); StorageDead(_23); goto -> bb4; } bb11: { unreachable; } }