// MIR for `forward_loop` after PreCodegen fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { debug start => _1; // in scope 0 at $DIR/range_iter.rs:+0:21: +0:26 debug end => _2; // in scope 0 at $DIR/range_iter.rs:+0:33: +0:36 debug f => _3; // in scope 0 at $DIR/range_iter.rs:+0:43: +0:44 let mut _0: (); // return place in scope 0 at $DIR/range_iter.rs:+0:60: +0:60 let mut _4: std::ops::Range; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:24 let mut _5: std::ops::Range; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:24 let _6: (); // in scope 0 at $DIR/range_iter.rs:+1:14: +1:24 let mut _7: std::option::Option; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:24 let mut _8: &mut std::ops::Range; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:24 let mut _9: isize; // in scope 0 at $DIR/range_iter.rs:+1:5: +3:6 let mut _11: &impl Fn(u32); // in scope 0 at $DIR/range_iter.rs:+2:9: +2:10 let mut _12: (u32,); // in scope 0 at $DIR/range_iter.rs:+2:9: +2:13 scope 1 { debug iter => _5; // in scope 1 at $DIR/range_iter.rs:+1:14: +1:24 let _10: u32; // in scope 1 at $DIR/range_iter.rs:+1:9: +1:10 scope 2 { debug x => _10; // in scope 2 at $DIR/range_iter.rs:+1:9: +1:10 } scope 4 (inlined iter::range::>::next) { // at $DIR/range_iter.rs:21:14: 21:24 debug self => _8; // in scope 4 at $SRC_DIR/core/src/iter/range.rs:LL:COL } } scope 3 (inlined as IntoIterator>::into_iter) { // at $DIR/range_iter.rs:21:14: 21:24 debug self => _4; // in scope 3 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL } bb0: { _4 = std::ops::Range:: { start: _1, end: _2 }; // scope 0 at $DIR/range_iter.rs:+1:14: +1:24 StorageLive(_5); // scope 0 at $DIR/range_iter.rs:+1:14: +1:24 _5 = move _4; // scope 0 at $DIR/range_iter.rs:+1:14: +1:24 goto -> bb1; // scope 1 at $DIR/range_iter.rs:+1:5: +3:6 } bb1: { StorageLive(_7); // scope 1 at $DIR/range_iter.rs:+1:14: +1:24 _8 = &mut _5; // scope 1 at $DIR/range_iter.rs:+1:14: +1:24 _7 = as iter::range::RangeIteratorImpl>::spec_next(_8) -> [return: bb9, unwind: bb7]; // scope 4 at $SRC_DIR/core/src/iter/range.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/iter/range.rs:LL:COL // + literal: Const { ty: for<'a> fn(&'a mut std::ops::Range) -> Option< as iter::range::RangeIteratorImpl>::Item> { as iter::range::RangeIteratorImpl>::spec_next}, val: Value() } } bb2: { _10 = ((_7 as Some).0: u32); // scope 1 at $DIR/range_iter.rs:+1:9: +1:10 StorageLive(_11); // scope 2 at $DIR/range_iter.rs:+2:9: +2:10 _11 = &_3; // scope 2 at $DIR/range_iter.rs:+2:9: +2:10 StorageLive(_12); // scope 2 at $DIR/range_iter.rs:+2:9: +2:13 _12 = (_10,); // scope 2 at $DIR/range_iter.rs:+2:9: +2:13 _6 = >::call(move _11, move _12) -> [return: bb5, unwind: bb7]; // scope 2 at $DIR/range_iter.rs:+2:9: +2:13 // mir::Constant // + span: $DIR/range_iter.rs:22:9: 22:10 // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a impl Fn(u32), (u32,)) -> >::Output {>::call}, val: Value() } } bb3: { unreachable; // scope 1 at $DIR/range_iter.rs:+1:14: +1:24 } bb4: { StorageDead(_7); // scope 1 at $DIR/range_iter.rs:+3:5: +3:6 StorageDead(_5); // scope 0 at $DIR/range_iter.rs:+3:5: +3:6 drop(_3) -> bb6; // scope 0 at $DIR/range_iter.rs:+4:1: +4:2 } bb5: { StorageDead(_12); // scope 2 at $DIR/range_iter.rs:+2:12: +2:13 StorageDead(_11); // scope 2 at $DIR/range_iter.rs:+2:12: +2:13 StorageDead(_7); // scope 1 at $DIR/range_iter.rs:+3:5: +3:6 goto -> bb1; // scope 1 at $DIR/range_iter.rs:+1:5: +3:6 } bb6: { return; // scope 0 at $DIR/range_iter.rs:+4:2: +4:2 } bb7 (cleanup): { drop(_3) -> [return: bb8, unwind terminate]; // scope 0 at $DIR/range_iter.rs:+4:1: +4:2 } bb8 (cleanup): { resume; // scope 0 at $DIR/range_iter.rs:+0:1: +4:2 } bb9: { _9 = discriminant(_7); // scope 1 at $DIR/range_iter.rs:+1:14: +1:24 switchInt(move _9) -> [0: bb4, 1: bb2, otherwise: bb3]; // scope 1 at $DIR/range_iter.rs:+1:14: +1:24 } }