// MIR for `reverse_loop` after PreCodegen fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { debug slice => _1; // in scope 0 at $DIR/slice_iter.rs:+0:28: +0:33 debug f => _2; // in scope 0 at $DIR/slice_iter.rs:+0:44: +0:45 let mut _0: (); // return place in scope 0 at $DIR/slice_iter.rs:+0:60: +0:60 let mut _3: std::iter::Rev>; // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:32 let mut _4: std::slice::Iter<'_, T>; // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:26 let mut _5: std::iter::Rev>; // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:32 let _6: (); // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:32 let mut _7: std::option::Option<&T>; // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:32 let mut _8: &mut std::iter::Rev>; // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:32 let mut _9: isize; // in scope 0 at $DIR/slice_iter.rs:+1:5: +3:6 let mut _11: &impl Fn(&T); // in scope 0 at $DIR/slice_iter.rs:+2:9: +2:10 let mut _12: (&T,); // in scope 0 at $DIR/slice_iter.rs:+2:9: +2:13 scope 1 { debug iter => _5; // in scope 1 at $DIR/slice_iter.rs:+1:14: +1:32 let _10: &T; // in scope 1 at $DIR/slice_iter.rs:+1:9: +1:10 scope 2 { debug x => _10; // in scope 2 at $DIR/slice_iter.rs:+1:9: +1:10 } scope 7 (inlined > as Iterator>::next) { // at $DIR/slice_iter.rs:35:14: 35:32 debug self => _8; // in scope 7 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL let mut _13: &mut std::slice::Iter<'_, T>; // in scope 7 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL } } scope 3 (inlined core::slice::::iter) { // at $DIR/slice_iter.rs:35:20: 35:26 debug self => _1; // in scope 3 at $SRC_DIR/core/src/slice/mod.rs:LL:COL } scope 4 (inlined as Iterator>::rev) { // at $DIR/slice_iter.rs:35:27: 35:32 debug self => _4; // in scope 4 at $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL scope 5 (inlined Rev::>::new) { // at $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL debug iter => _4; // in scope 5 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL } } scope 6 (inlined > as IntoIterator>::into_iter) { // at $DIR/slice_iter.rs:35:14: 35:32 debug self => _3; // in scope 6 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL } bb0: { StorageLive(_4); // scope 0 at $DIR/slice_iter.rs:+1:14: +1:26 _4 = std::slice::Iter::<'_, T>::new(_1) -> [return: bb9, unwind: bb7]; // scope 3 at $SRC_DIR/core/src/slice/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/slice/mod.rs:LL:COL // + user_ty: UserType(0) // + literal: Const { ty: fn(&[T]) -> std::slice::Iter<'_, T> {std::slice::Iter::<'_, T>::new}, val: Value() } } bb1: { StorageLive(_7); // scope 1 at $DIR/slice_iter.rs:+1:14: +1:32 _8 = &mut _5; // scope 1 at $DIR/slice_iter.rs:+1:14: +1:32 StorageLive(_13); // scope 7 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL _13 = &mut ((*_8).0: std::slice::Iter<'_, T>); // scope 7 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL _7 = as DoubleEndedIterator>::next_back(move _13) -> [return: bb10, unwind: bb7]; // scope 7 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL // + literal: Const { ty: for<'a> fn(&'a mut std::slice::Iter<'_, T>) -> Option< as Iterator>::Item> { as DoubleEndedIterator>::next_back}, val: Value() } } bb2: { _10 = ((_7 as Some).0: &T); // scope 1 at $DIR/slice_iter.rs:+1:9: +1:10 StorageLive(_11); // scope 2 at $DIR/slice_iter.rs:+2:9: +2:10 _11 = &_2; // scope 2 at $DIR/slice_iter.rs:+2:9: +2:10 StorageLive(_12); // scope 2 at $DIR/slice_iter.rs:+2:9: +2:13 _12 = (_10,); // scope 2 at $DIR/slice_iter.rs:+2:9: +2:13 _6 = >::call(move _11, move _12) -> [return: bb5, unwind: bb7]; // scope 2 at $DIR/slice_iter.rs:+2:9: +2:13 // mir::Constant // + span: $DIR/slice_iter.rs:36:9: 36:10 // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a impl Fn(&T), (&T,)) -> >::Output {>::call}, val: Value() } } bb3: { unreachable; // scope 1 at $DIR/slice_iter.rs:+1:14: +1:32 } bb4: { StorageDead(_7); // scope 1 at $DIR/slice_iter.rs:+3:5: +3:6 StorageDead(_5); // scope 0 at $DIR/slice_iter.rs:+3:5: +3:6 drop(_2) -> bb6; // scope 0 at $DIR/slice_iter.rs:+4:1: +4:2 } bb5: { StorageDead(_12); // scope 2 at $DIR/slice_iter.rs:+2:12: +2:13 StorageDead(_11); // scope 2 at $DIR/slice_iter.rs:+2:12: +2:13 StorageDead(_7); // scope 1 at $DIR/slice_iter.rs:+3:5: +3:6 goto -> bb1; // scope 1 at $DIR/slice_iter.rs:+1:5: +3:6 } bb6: { return; // scope 0 at $DIR/slice_iter.rs:+4:2: +4:2 } bb7 (cleanup): { drop(_2) -> [return: bb8, unwind terminate]; // scope 0 at $DIR/slice_iter.rs:+4:1: +4:2 } bb8 (cleanup): { resume; // scope 0 at $DIR/slice_iter.rs:+0:1: +4:2 } bb9: { _3 = Rev::> { iter: move _4 }; // scope 5 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL StorageDead(_4); // scope 0 at $DIR/slice_iter.rs:+1:31: +1:32 StorageLive(_5); // scope 0 at $DIR/slice_iter.rs:+1:14: +1:32 _5 = move _3; // scope 0 at $DIR/slice_iter.rs:+1:14: +1:32 goto -> bb1; // scope 1 at $DIR/slice_iter.rs:+1:5: +3:6 } bb10: { StorageDead(_13); // scope 7 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL _9 = discriminant(_7); // scope 1 at $DIR/slice_iter.rs:+1:14: +1:32 switchInt(move _9) -> [0: bb4, 1: bb2, otherwise: bb3]; // scope 1 at $DIR/slice_iter.rs:+1:14: +1:32 } }