// MIR for `mapped` after PreCodegen fn mapped(_1: impl Iterator, _2: impl Fn(T) -> U) -> () { debug iter => _1; debug f => _2; let mut _0: (); let mut _3: std::iter::Map, impl Fn(T) -> U>; let mut _4: std::iter::Map, impl Fn(T) -> U>; let mut _5: std::iter::Map, impl Fn(T) -> U>; let mut _6: &mut std::iter::Map, impl Fn(T) -> U>; let mut _7: std::option::Option; let mut _8: isize; let _10: (); scope 1 { debug iter => _5; let _9: U; scope 2 { debug x => _9; } } scope 3 (inlined , impl Fn(T) -> U> as IntoIterator>::into_iter) { debug self => _3; } bb0: { StorageLive(_4); StorageLive(_3); _3 = as Iterator>::map:: U>(move _1, move _2) -> bb1; } bb1: { _4 = move _3; StorageDead(_3); StorageLive(_5); _5 = move _4; goto -> bb2; } bb2: { StorageLive(_7); _6 = &mut _5; _7 = , impl Fn(T) -> U> as Iterator>::next(_6) -> [return: bb3, unwind: bb9]; } bb3: { _8 = discriminant(_7); switchInt(move _8) -> [0: bb4, 1: bb6, otherwise: bb8]; } bb4: { StorageDead(_7); drop(_5) -> bb5; } bb5: { StorageDead(_5); StorageDead(_4); return; } bb6: { _9 = move ((_7 as Some).0: U); _10 = opaque::(move _9) -> [return: bb7, unwind: bb9]; } bb7: { StorageDead(_7); goto -> bb2; } bb8: { unreachable; } bb9 (cleanup): { drop(_5) -> [return: bb10, unwind terminate]; } bb10 (cleanup): { resume; } }