rust/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

79 lines
1.8 KiB
Rust
Raw Normal View History

2023-05-16 07:24:38 -05:00
// MIR for `mapped` after PreCodegen
fn mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> U) -> () {
2023-06-06 08:47:00 -05:00
debug iter => _1;
debug f => _2;
let mut _0: ();
let mut _3: std::iter::Map<impl Iterator<Item = T>, impl Fn(T) -> U>;
let mut _4: std::iter::Map<impl Iterator<Item = T>, impl Fn(T) -> U>;
let mut _5: &mut std::iter::Map<impl Iterator<Item = T>, impl Fn(T) -> U>;
let mut _6: std::option::Option<U>;
let mut _7: isize;
let _9: ();
2023-05-16 07:24:38 -05:00
scope 1 {
debug iter => _4;
let _8: U;
2023-05-16 07:24:38 -05:00
scope 2 {
debug x => _8;
2023-05-16 07:24:38 -05:00
}
}
2023-06-06 08:47:00 -05:00
scope 3 (inlined <Map<impl Iterator<Item = T>, impl Fn(T) -> U> as IntoIterator>::into_iter) {
debug self => _3;
2023-05-16 07:24:38 -05:00
}
bb0: {
2023-06-23 11:53:09 -05:00
_3 = <impl Iterator<Item = T> as Iterator>::map::<U, impl Fn(T) -> U>(move _1, move _2) -> [return: bb1, unwind continue];
2023-05-16 07:24:38 -05:00
}
bb1: {
StorageLive(_4);
2023-06-06 08:47:00 -05:00
_4 = move _3;
goto -> bb2;
2023-05-16 07:24:38 -05:00
}
bb2: {
2023-03-12 09:10:30 -05:00
StorageLive(_6);
StorageLive(_5);
_5 = &mut _4;
_6 = <Map<impl Iterator<Item = T>, impl Fn(T) -> U> as Iterator>::next(move _5) -> [return: bb3, unwind: bb9];
2023-05-16 07:24:38 -05:00
}
bb3: {
StorageDead(_5);
_7 = discriminant(_6);
switchInt(move _7) -> [0: bb4, 1: bb6, otherwise: bb8];
2023-05-16 07:24:38 -05:00
}
bb4: {
StorageDead(_6);
drop(_4) -> [return: bb5, unwind continue];
2023-05-16 07:24:38 -05:00
}
bb5: {
2023-06-06 08:47:00 -05:00
StorageDead(_4);
return;
2023-05-16 07:24:38 -05:00
}
bb6: {
_8 = move ((_6 as Some).0: U);
_9 = opaque::<U>(move _8) -> [return: bb7, unwind: bb9];
2023-05-16 07:24:38 -05:00
}
bb7: {
StorageDead(_6);
2023-06-06 08:47:00 -05:00
goto -> bb2;
2023-05-16 07:24:38 -05:00
}
bb8: {
2023-06-06 08:47:00 -05:00
unreachable;
2023-05-16 07:24:38 -05:00
}
bb9 (cleanup): {
drop(_4) -> [return: bb10, unwind terminate(cleanup)];
2023-05-16 07:24:38 -05:00
}
bb10 (cleanup): {
2023-06-06 08:47:00 -05:00
resume;
2023-05-16 07:24:38 -05:00
}
}