]> git.proxmox.com Git - rustc.git/blob - tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / mir-opt / issues / issue_59352.num_to_digit.PreCodegen.after.mir
1 // MIR for `num_to_digit` after PreCodegen
2
3 fn num_to_digit(_1: char) -> u32 {
4 debug num => _1; // in scope 0 at $DIR/issue_59352.rs:+0:21: +0:24
5 let mut _0: u32; // return place in scope 0 at $DIR/issue_59352.rs:+0:35: +0:38
6 let mut _2: std::option::Option<u32>; // in scope 0 at $DIR/issue_59352.rs:+2:26: +2:41
7 let mut _3: u32; // in scope 0 at $DIR/issue_59352.rs:+2:12: +2:23
8 let mut _9: isize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
9 scope 1 (inlined char::methods::<impl char>::is_digit) { // at $DIR/issue_59352.rs:14:12: 14:23
10 debug self => _1; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
11 debug radix => _3; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
12 let mut _4: &std::option::Option<u32>; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
13 let _5: std::option::Option<u32>; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
14 let mut _6: char; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
15 scope 2 (inlined Option::<u32>::is_some) { // at $SRC_DIR/core/src/char/methods.rs:LL:COL
16 debug self => _4; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL
17 }
18 }
19 scope 3 (inlined #[track_caller] Option::<u32>::unwrap) { // at $DIR/issue_59352.rs:14:42: 14:50
20 debug self => _2; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
21 let mut _7: isize; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
22 let mut _8: !; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
23 scope 4 {
24 debug val => _0; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL
25 }
26 }
27
28 bb0: {
29 StorageLive(_3); // scope 0 at $DIR/issue_59352.rs:+2:12: +2:23
30 StorageLive(_4); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
31 StorageLive(_5); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
32 StorageLive(_6); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
33 _6 = _1; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
34 _5 = char::methods::<impl char>::to_digit(move _6, const 8_u32) -> bb5; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
35 // mir::Constant
36 // + span: $SRC_DIR/core/src/char/methods.rs:LL:COL
37 // + literal: Const { ty: fn(char, u32) -> Option<u32> {char::methods::<impl char>::to_digit}, val: Value(<ZST>) }
38 }
39
40 bb1: {
41 StorageLive(_2); // scope 0 at $DIR/issue_59352.rs:+2:26: +2:41
42 _2 = char::methods::<impl char>::to_digit(move _1, const 8_u32) -> bb2; // scope 0 at $DIR/issue_59352.rs:+2:26: +2:41
43 // mir::Constant
44 // + span: $DIR/issue_59352.rs:14:30: 14:38
45 // + literal: Const { ty: fn(char, u32) -> Option<u32> {char::methods::<impl char>::to_digit}, val: Value(<ZST>) }
46 }
47
48 bb2: {
49 _7 = discriminant(_2); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
50 switchInt(move _7) -> [0: bb6, 1: bb8, otherwise: bb7]; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
51 }
52
53 bb3: {
54 _0 = const 0_u32; // scope 0 at $DIR/issue_59352.rs:+2:60: +2:61
55 goto -> bb4; // scope 0 at $DIR/issue_59352.rs:+2:5: +2:63
56 }
57
58 bb4: {
59 return; // scope 0 at $DIR/issue_59352.rs:+3:2: +3:2
60 }
61
62 bb5: {
63 _4 = &_5; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
64 StorageDead(_6); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
65 _9 = discriminant((*_4)); // scope 2 at $SRC_DIR/core/src/option.rs:LL:COL
66 StorageDead(_4); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
67 StorageDead(_5); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
68 StorageDead(_3); // scope 0 at $DIR/issue_59352.rs:+2:12: +2:23
69 switchInt(move _9) -> [1: bb1, otherwise: bb3]; // scope 0 at $DIR/issue_59352.rs:+2:8: +2:23
70 }
71
72 bb6: {
73 StorageLive(_8); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
74 _8 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value"); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
75 // mir::Constant
76 // + span: $SRC_DIR/core/src/option.rs:LL:COL
77 // + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value(<ZST>) }
78 // mir::Constant
79 // + span: $SRC_DIR/core/src/option.rs:LL:COL
80 // + literal: Const { ty: &str, val: Value(Slice(..)) }
81 }
82
83 bb7: {
84 unreachable; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
85 }
86
87 bb8: {
88 _0 = move ((_2 as Some).0: u32); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
89 StorageDead(_2); // scope 0 at $DIR/issue_59352.rs:+2:49: +2:50
90 goto -> bb4; // scope 0 at $DIR/issue_59352.rs:+2:5: +2:63
91 }
92 }