// MIR for `num_to_digit` after PreCodegen fn num_to_digit(_1: char) -> u32 { debug num => _1; // in scope 0 at $DIR/issue_59352.rs:+0:21: +0:24 let mut _0: u32; // return place in scope 0 at $DIR/issue_59352.rs:+0:35: +0:38 let mut _5: std::option::Option; // in scope 0 at $DIR/issue_59352.rs:+2:26: +2:41 scope 1 (inlined char::methods::::is_digit) { // at $DIR/issue_59352.rs:15:12: 15:23 debug self => _1; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL debug radix => const 8_u32; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL let _2: std::option::Option; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL let mut _3: &std::option::Option; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL scope 2 (inlined Option::::is_some) { // at $SRC_DIR/core/src/char/methods.rs:LL:COL debug self => _3; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL let mut _4: isize; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL } } scope 3 (inlined #[track_caller] Option::::unwrap) { // at $DIR/issue_59352.rs:15:42: 15:50 debug self => _5; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL let mut _6: isize; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL let mut _7: !; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL scope 4 { debug val => _0; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL } } bb0: { StorageLive(_3); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL StorageLive(_2); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL _2 = char::methods::::to_digit(_1, const 8_u32) -> [return: bb1, unwind unreachable]; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/char/methods.rs:LL:COL // + literal: Const { ty: fn(char, u32) -> Option {char::methods::::to_digit}, val: Value() } } bb1: { _3 = &_2; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL _4 = discriminant((*_3)); // scope 2 at $SRC_DIR/core/src/option.rs:LL:COL StorageDead(_3); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL StorageDead(_2); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL switchInt(move _4) -> [1: bb2, otherwise: bb7]; // scope 0 at $DIR/issue_59352.rs:+2:8: +2:23 } bb2: { StorageLive(_5); // scope 0 at $DIR/issue_59352.rs:+2:26: +2:41 _5 = char::methods::::to_digit(_1, const 8_u32) -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/issue_59352.rs:+2:26: +2:41 // mir::Constant // + span: $DIR/issue_59352.rs:15:30: 15:38 // + literal: Const { ty: fn(char, u32) -> Option {char::methods::::to_digit}, val: Value() } } bb3: { _6 = discriminant(_5); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL switchInt(move _6) -> [0: bb4, 1: bb5, otherwise: bb6]; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL } bb4: { _7 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value") -> unwind unreachable; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/option.rs:LL:COL // + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value() } // mir::Constant // + span: $SRC_DIR/core/src/option.rs:LL:COL // + literal: Const { ty: &str, val: Value(Slice(..)) } } bb5: { _0 = move ((_5 as Some).0: u32); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL StorageDead(_5); // scope 0 at $DIR/issue_59352.rs:+2:49: +2:50 goto -> bb8; // scope 0 at $DIR/issue_59352.rs:+2:5: +2:63 } bb6: { unreachable; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL } bb7: { _0 = const 0_u32; // scope 0 at $DIR/issue_59352.rs:+2:60: +2:61 goto -> bb8; // scope 0 at $DIR/issue_59352.rs:+2:5: +2:63 } bb8: { return; // scope 0 at $DIR/issue_59352.rs:+3:2: +3:2 } }