|
| 1 | +// MIR for `filter_mapped` after PreCodegen |
| 2 | + |
| 3 | +fn filter_mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> Option<U>) -> () { |
| 4 | + debug iter => _1; // in scope 0 at $DIR/loops.rs:+0:28: +0:32 |
| 5 | + debug f => _2; // in scope 0 at $DIR/loops.rs:+0:59: +0:60 |
| 6 | + let mut _0: (); // return place in scope 0 at $DIR/loops.rs:+0:87: +0:87 |
| 7 | + let mut _3: std::iter::FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>>; // in scope 0 at $DIR/loops.rs:+1:14: +1:32 |
| 8 | + let mut _4: std::iter::FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>>; // in scope 0 at $DIR/loops.rs:+1:14: +1:32 |
| 9 | + let mut _5: std::iter::FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>>; // in scope 0 at $DIR/loops.rs:+1:14: +1:32 |
| 10 | + let mut _6: &mut std::iter::FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>>; // in scope 0 at $DIR/loops.rs:+1:14: +1:32 |
| 11 | + let mut _9: std::option::Option<U>; // in scope 0 at $DIR/loops.rs:+1:14: +1:32 |
| 12 | + let mut _10: isize; // in scope 0 at $DIR/loops.rs:+1:5: +3:6 |
| 13 | + let _12: (); // in scope 0 at $DIR/loops.rs:+1:14: +1:32 |
| 14 | + scope 1 { |
| 15 | + debug iter => _5; // in scope 1 at $DIR/loops.rs:+1:14: +1:32 |
| 16 | + let _11: U; // in scope 1 at $DIR/loops.rs:+1:9: +1:10 |
| 17 | + scope 2 { |
| 18 | + debug x => _11; // in scope 2 at $DIR/loops.rs:+1:9: +1:10 |
| 19 | + } |
| 20 | + scope 4 (inlined <FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>> as Iterator>::next) { // at $DIR/loops.rs:19:14: 19:32 |
| 21 | + debug self => _6; // in scope 4 at $SRC_DIR/core/src/iter/adapters/filter_map.rs:LL:COL |
| 22 | + let mut _7: &mut impl Iterator<Item = T>; // in scope 4 at $SRC_DIR/core/src/iter/adapters/filter_map.rs:LL:COL |
| 23 | + let mut _8: &mut impl Fn(T) -> Option<U>; // in scope 4 at $SRC_DIR/core/src/iter/adapters/filter_map.rs:LL:COL |
| 24 | + } |
| 25 | + } |
| 26 | + scope 3 (inlined <FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>> as IntoIterator>::into_iter) { // at $DIR/loops.rs:19:14: 19:32 |
| 27 | + debug self => _3; // in scope 3 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL |
| 28 | + } |
| 29 | + |
| 30 | + bb0: { |
| 31 | + StorageLive(_4); // scope 0 at $DIR/loops.rs:+1:14: +1:32 |
| 32 | + StorageLive(_3); // scope 0 at $DIR/loops.rs:+1:14: +1:32 |
| 33 | + _3 = <impl Iterator<Item = T> as Iterator>::filter_map::<U, impl Fn(T) -> Option<U>>(move _1, move _2) -> bb1; // scope 0 at $DIR/loops.rs:+1:14: +1:32 |
| 34 | + // mir::Constant |
| 35 | + // + span: $DIR/loops.rs:19:19: 19:29 |
| 36 | + // + literal: Const { ty: fn(impl Iterator<Item = T>, impl Fn(T) -> Option<U>) -> FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>> {<impl Iterator<Item = T> as Iterator>::filter_map::<U, impl Fn(T) -> Option<U>>}, val: Value(<ZST>) } |
| 37 | + } |
| 38 | + |
| 39 | + bb1: { |
| 40 | + _4 = move _3; // scope 3 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL |
| 41 | + StorageDead(_3); // scope 0 at $DIR/loops.rs:+1:31: +1:32 |
| 42 | + StorageLive(_5); // scope 0 at $DIR/loops.rs:+1:14: +1:32 |
| 43 | + _5 = move _4; // scope 0 at $DIR/loops.rs:+1:14: +1:32 |
| 44 | + goto -> bb2; // scope 1 at $DIR/loops.rs:+1:5: +3:6 |
| 45 | + } |
| 46 | + |
| 47 | + bb2: { |
| 48 | + StorageLive(_9); // scope 1 at $DIR/loops.rs:+1:14: +1:32 |
| 49 | + _6 = &mut _5; // scope 1 at $DIR/loops.rs:+1:14: +1:32 |
| 50 | + StorageLive(_7); // scope 4 at $SRC_DIR/core/src/iter/adapters/filter_map.rs:LL:COL |
| 51 | + _7 = &mut ((*_6).0: impl Iterator<Item = T>); // scope 4 at $SRC_DIR/core/src/iter/adapters/filter_map.rs:LL:COL |
| 52 | + StorageLive(_8); // scope 4 at $SRC_DIR/core/src/iter/adapters/filter_map.rs:LL:COL |
| 53 | + _8 = &mut ((*_6).1: impl Fn(T) -> Option<U>); // scope 4 at $SRC_DIR/core/src/iter/adapters/filter_map.rs:LL:COL |
| 54 | + _9 = <impl Iterator<Item = T> as Iterator>::find_map::<U, &mut impl Fn(T) -> Option<U>>(move _7, move _8) -> [return: bb3, unwind: bb9]; // scope 4 at $SRC_DIR/core/src/iter/adapters/filter_map.rs:LL:COL |
| 55 | + // mir::Constant |
| 56 | + // + span: $SRC_DIR/core/src/iter/adapters/filter_map.rs:LL:COL |
| 57 | + // + literal: Const { ty: for<'a> fn(&'a mut impl Iterator<Item = T>, &mut impl Fn(T) -> Option<U>) -> Option<U> {<impl Iterator<Item = T> as Iterator>::find_map::<U, &mut impl Fn(T) -> Option<U>>}, val: Value(<ZST>) } |
| 58 | + } |
| 59 | + |
| 60 | + bb3: { |
| 61 | + StorageDead(_8); // scope 4 at $SRC_DIR/core/src/iter/adapters/filter_map.rs:LL:COL |
| 62 | + StorageDead(_7); // scope 4 at $SRC_DIR/core/src/iter/adapters/filter_map.rs:LL:COL |
| 63 | + _10 = discriminant(_9); // scope 1 at $DIR/loops.rs:+1:14: +1:32 |
| 64 | + switchInt(move _10) -> [0: bb4, 1: bb6, otherwise: bb8]; // scope 1 at $DIR/loops.rs:+1:14: +1:32 |
| 65 | + } |
| 66 | + |
| 67 | + bb4: { |
| 68 | + StorageDead(_9); // scope 1 at $DIR/loops.rs:+3:5: +3:6 |
| 69 | + drop(_5) -> bb5; // scope 0 at $DIR/loops.rs:+3:5: +3:6 |
| 70 | + } |
| 71 | + |
| 72 | + bb5: { |
| 73 | + StorageDead(_5); // scope 0 at $DIR/loops.rs:+3:5: +3:6 |
| 74 | + StorageDead(_4); // scope 0 at $DIR/loops.rs:+3:5: +3:6 |
| 75 | + return; // scope 0 at $DIR/loops.rs:+4:2: +4:2 |
| 76 | + } |
| 77 | + |
| 78 | + bb6: { |
| 79 | + _11 = move ((_9 as Some).0: U); // scope 1 at $DIR/loops.rs:+1:9: +1:10 |
| 80 | + _12 = opaque::<U>(move _11) -> [return: bb7, unwind: bb9]; // scope 2 at $DIR/loops.rs:+2:9: +2:18 |
| 81 | + // mir::Constant |
| 82 | + // + span: $DIR/loops.rs:20:9: 20:15 |
| 83 | + // + literal: Const { ty: fn(U) {opaque::<U>}, val: Value(<ZST>) } |
| 84 | + } |
| 85 | + |
| 86 | + bb7: { |
| 87 | + StorageDead(_9); // scope 1 at $DIR/loops.rs:+3:5: +3:6 |
| 88 | + goto -> bb2; // scope 1 at $DIR/loops.rs:+1:5: +3:6 |
| 89 | + } |
| 90 | + |
| 91 | + bb8: { |
| 92 | + unreachable; // scope 1 at $DIR/loops.rs:+1:14: +1:32 |
| 93 | + } |
| 94 | + |
| 95 | + bb9 (cleanup): { |
| 96 | + drop(_5) -> [return: bb10, unwind terminate]; // scope 0 at $DIR/loops.rs:+3:5: +3:6 |
| 97 | + } |
| 98 | + |
| 99 | + bb10 (cleanup): { |
| 100 | + resume; // scope 0 at $DIR/loops.rs:+0:1: +4:2 |
| 101 | + } |
| 102 | +} |
0 commit comments