|
| 1 | +// MIR for `int_range` after PreCodegen |
| 2 | + |
| 3 | +fn int_range(_1: usize, _2: usize) -> () { |
| 4 | + debug start => _1; // in scope 0 at $DIR/loops.rs:+0:18: +0:23 |
| 5 | + debug end => _2; // in scope 0 at $DIR/loops.rs:+0:32: +0:35 |
| 6 | + let mut _0: (); // return place in scope 0 at $DIR/loops.rs:+0:44: +0:44 |
| 7 | + let mut _3: std::ops::Range<usize>; // in scope 0 at $DIR/loops.rs:+1:14: +1:24 |
| 8 | + let mut _4: std::ops::Range<usize>; // in scope 0 at $DIR/loops.rs:+1:14: +1:24 |
| 9 | + let mut _5: &mut std::ops::Range<usize>; // in scope 0 at $DIR/loops.rs:+1:14: +1:24 |
| 10 | + let mut _6: std::option::Option<usize>; // in scope 0 at $DIR/loops.rs:+1:14: +1:24 |
| 11 | + let mut _7: isize; // in scope 0 at $DIR/loops.rs:+1:5: +3:6 |
| 12 | + let _9: (); // in scope 0 at $DIR/loops.rs:+1:14: +1:24 |
| 13 | + scope 1 { |
| 14 | + debug iter => _4; // in scope 1 at $DIR/loops.rs:+1:14: +1:24 |
| 15 | + let _8: usize; // in scope 1 at $DIR/loops.rs:+1:9: +1:10 |
| 16 | + scope 2 { |
| 17 | + debug i => _8; // in scope 2 at $DIR/loops.rs:+1:9: +1:10 |
| 18 | + } |
| 19 | + scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) { // at $DIR/loops.rs:7:14: 7:24 |
| 20 | + debug self => _5; // in scope 4 at $SRC_DIR/core/src/iter/range.rs:LL:COL |
| 21 | + } |
| 22 | + } |
| 23 | + scope 3 (inlined <std::ops::Range<usize> as IntoIterator>::into_iter) { // at $DIR/loops.rs:7:14: 7:24 |
| 24 | + debug self => _3; // in scope 3 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL |
| 25 | + } |
| 26 | + |
| 27 | + bb0: { |
| 28 | + _3 = std::ops::Range::<usize> { start: _1, end: _2 }; // scope 0 at $DIR/loops.rs:+1:14: +1:24 |
| 29 | + StorageLive(_4); // scope 0 at $DIR/loops.rs:+1:14: +1:24 |
| 30 | + _4 = move _3; // scope 0 at $DIR/loops.rs:+1:14: +1:24 |
| 31 | + goto -> bb1; // scope 1 at $DIR/loops.rs:+1:5: +3:6 |
| 32 | + } |
| 33 | + |
| 34 | + bb1: { |
| 35 | + StorageLive(_6); // scope 1 at $DIR/loops.rs:+1:14: +1:24 |
| 36 | + _5 = &mut _4; // scope 1 at $DIR/loops.rs:+1:14: +1:24 |
| 37 | + _6 = <std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next(_5) -> bb2; // scope 4 at $SRC_DIR/core/src/iter/range.rs:LL:COL |
| 38 | + // mir::Constant |
| 39 | + // + span: $SRC_DIR/core/src/iter/range.rs:LL:COL |
| 40 | + // + literal: Const { ty: for<'a> fn(&'a mut std::ops::Range<usize>) -> Option<<std::ops::Range<usize> as iter::range::RangeIteratorImpl>::Item> {<std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next}, val: Value(<ZST>) } |
| 41 | + } |
| 42 | + |
| 43 | + bb2: { |
| 44 | + _7 = discriminant(_6); // scope 1 at $DIR/loops.rs:+1:14: +1:24 |
| 45 | + switchInt(move _7) -> [0: bb3, 1: bb4, otherwise: bb6]; // scope 1 at $DIR/loops.rs:+1:14: +1:24 |
| 46 | + } |
| 47 | + |
| 48 | + bb3: { |
| 49 | + StorageDead(_6); // scope 1 at $DIR/loops.rs:+3:5: +3:6 |
| 50 | + StorageDead(_4); // scope 0 at $DIR/loops.rs:+3:5: +3:6 |
| 51 | + return; // scope 0 at $DIR/loops.rs:+4:2: +4:2 |
| 52 | + } |
| 53 | + |
| 54 | + bb4: { |
| 55 | + _8 = ((_6 as Some).0: usize); // scope 1 at $DIR/loops.rs:+1:9: +1:10 |
| 56 | + _9 = opaque::<usize>(_8) -> bb5; // scope 2 at $DIR/loops.rs:+2:9: +2:18 |
| 57 | + // mir::Constant |
| 58 | + // + span: $DIR/loops.rs:8:9: 8:15 |
| 59 | + // + literal: Const { ty: fn(usize) {opaque::<usize>}, val: Value(<ZST>) } |
| 60 | + } |
| 61 | + |
| 62 | + bb5: { |
| 63 | + StorageDead(_6); // scope 1 at $DIR/loops.rs:+3:5: +3:6 |
| 64 | + goto -> bb1; // scope 1 at $DIR/loops.rs:+1:5: +3:6 |
| 65 | + } |
| 66 | + |
| 67 | + bb6: { |
| 68 | + unreachable; // scope 1 at $DIR/loops.rs:+1:14: +1:24 |
| 69 | + } |
| 70 | +} |
0 commit comments