1 // MIR for `range_loop` after PreCodegen
3 fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
8 let mut _4: std::ops::Range<usize>;
9 let mut _5: std::ops::Range<usize>;
10 let mut _9: std::option::Option<usize>;
14 let mut _17: &impl Fn(usize, &T);
15 let mut _18: (usize, &T);
17 let mut _20: &mut std::ops::Range<usize>;
28 scope 5 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) {
30 scope 6 (inlined <std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next) {
42 scope 9 (inlined cmp::impls::<impl PartialOrd for usize>::lt) {
51 scope 4 (inlined <std::ops::Range<usize> as IntoIterator>::into_iter) {
58 _4 = std::ops::Range::<usize> { start: const 0_usize, end: move _3 };
75 _8 = Lt(move _6, move _7);
78 switchInt(move _8) -> [0: bb2, otherwise: bb3];
84 _9 = Option::<usize>::None;
93 _11 = <usize as Step>::forward_unchecked(_10, const 1_usize) -> [return: bb4, unwind unreachable];
97 (_5.0: usize) = move _11;
99 _9 = Option::<usize>::Some(_10);
106 _12 = discriminant(_9);
107 switchInt(move _12) -> [0: bb6, 1: bb8, otherwise: bb11];
113 drop(_2) -> [return: bb7, unwind unreachable];
121 _13 = ((_9 as Some).0: usize);
124 assert(move _15, "index out of bounds: the length is {} but the index is {}", move _14, _13) -> [success: bb9, unwind unreachable];
133 _19 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _17, move _18) -> [return: bb10, unwind unreachable];