rust/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir
2023-06-23 18:36:25 +01:00

75 lines
1.5 KiB
Rust

// MIR for `vec_move` after PreCodegen
fn vec_move(_1: Vec<impl Sized>) -> () {
debug v => _1;
let mut _0: ();
let mut _2: std::vec::IntoIter<impl Sized>;
let mut _3: std::vec::IntoIter<impl Sized>;
let mut _4: &mut std::vec::IntoIter<impl Sized>;
let mut _5: std::option::Option<impl Sized>;
let mut _6: isize;
let _8: ();
scope 1 {
debug iter => _3;
let _7: impl Sized;
scope 2 {
debug x => _7;
}
}
bb0: {
StorageLive(_2);
_2 = <Vec<impl Sized> as IntoIterator>::into_iter(move _1) -> [return: bb1, unwind continue];
}
bb1: {
StorageLive(_3);
_3 = move _2;
goto -> bb2;
}
bb2: {
StorageLive(_5);
_4 = &mut _3;
_5 = <std::vec::IntoIter<impl Sized> as Iterator>::next(_4) -> [return: bb3, unwind: bb9];
}
bb3: {
_6 = discriminant(_5);
switchInt(move _6) -> [0: bb4, 1: bb6, otherwise: bb8];
}
bb4: {
StorageDead(_5);
drop(_3) -> [return: bb5, unwind continue];
}
bb5: {
StorageDead(_3);
StorageDead(_2);
return;
}
bb6: {
_7 = move ((_5 as Some).0: impl Sized);
_8 = opaque::<impl Sized>(move _7) -> [return: bb7, unwind: bb9];
}
bb7: {
StorageDead(_5);
goto -> bb2;
}
bb8: {
unreachable;
}
bb9 (cleanup): {
drop(_3) -> [return: bb10, unwind terminate];
}
bb10 (cleanup): {
resume;
}
}