0
0
mirror of https://github.com/rust-lang/rust.git synced 2024-12-01 04:21:19 +01:00
rust/tests/mir-opt/issue_91633.bar.built.after.mir
Nadrieril 3e030b38ef Return the otherwise_block instead of passing it as argument
This saves a few blocks and matches the common `unpack!` paradigm.
2024-07-09 22:47:35 +02:00

43 lines
810 B
Rust

// MIR for `bar` after built
fn bar(_1: Box<[T]>) -> () {
debug it => _1;
let mut _0: ();
let mut _2: &<[T] as std::ops::Index<usize>>::Output;
let mut _3: &[T];
scope 1 {
}
bb0: {
StorageLive(_2);
StorageLive(_3);
_3 = &(*_1);
_2 = <[T] as Index<usize>>::index(move _3, const 0_usize) -> [return: bb1, unwind: bb4];
}
bb1: {
StorageDead(_3);
PlaceMention((*_2));
StorageDead(_2);
_0 = const ();
drop(_1) -> [return: bb3, unwind: bb5];
}
bb2: {
FakeRead(ForMatchedPlace(None), (*_2));
unreachable;
}
bb3: {
return;
}
bb4 (cleanup): {
drop(_1) -> [return: bb5, unwind terminate(cleanup)];
}
bb5 (cleanup): {
resume;
}
}