rust/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.mir

42 lines
2.0 KiB
Rust
Raw Normal View History

2023-02-24 16:33:22 -05:00
// MIR for `unwrap_unchecked` after PreCodegen
fn unwrap_unchecked(_1: Option<T>) -> T {
debug slf => _1; // in scope 0 at $DIR/unwrap_unchecked.rs:+0:35: +0:38
let mut _0: T; // return place in scope 0 at $DIR/unwrap_unchecked.rs:+0:54: +0:55
scope 1 (inlined #[track_caller] Option::<T>::unwrap_unchecked) { // at $DIR/unwrap_unchecked.rs:10:9: 10:27
2023-02-24 16:33:22 -05:00
debug self => _1; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
let mut _2: isize; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
let mut _3: &std::option::Option<T>; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
2023-02-24 16:33:22 -05:00
scope 2 {
debug val => _0; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL
2023-02-24 16:33:22 -05:00
}
scope 3 {
scope 5 (inlined unreachable_unchecked) { // at $SRC_DIR/core/src/option.rs:LL:COL
scope 6 {
scope 7 (inlined unreachable_unchecked::runtime) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
}
}
}
}
scope 4 (inlined Option::<T>::is_some) { // at $SRC_DIR/core/src/option.rs:LL:COL
debug self => _3; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL
2023-02-24 16:33:22 -05:00
}
}
bb0: {
StorageLive(_3); // scope 0 at $DIR/unwrap_unchecked.rs:+1:9: +1:27
_2 = discriminant(_1); // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
switchInt(move _2) -> [1: bb1, otherwise: bb2]; // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
2023-02-24 16:33:22 -05:00
}
bb1: {
_0 = move ((_1 as Some).0: T); // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
StorageDead(_3); // scope 0 at $DIR/unwrap_unchecked.rs:+1:9: +1:27
return; // scope 0 at $DIR/unwrap_unchecked.rs:+2:2: +2:2
2023-02-24 16:33:22 -05:00
}
bb2: {
unreachable; // scope 6 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
2023-02-24 16:33:22 -05:00
}
}