]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff
rustdoc: Early doc link resolution fixes and refactorings
[rust.git] / src / test / mir-opt / simplify_arm.id_try.SimplifyBranchSame.diff
1 - // MIR for `id_try` before SimplifyBranchSame
2 + // MIR for `id_try` after SimplifyBranchSame
3   
4   fn id_try(_1: Result<u8, i32>) -> Result<u8, i32> {
5       debug r => _1;                       // in scope 0 at $DIR/simplify-arm.rs:35:11: 35:12
6       let mut _0: std::result::Result<u8, i32>; // return place in scope 0 at $DIR/simplify-arm.rs:35:34: 35:49
7       let _2: u8;                          // in scope 0 at $DIR/simplify-arm.rs:36:9: 36:10
8       let mut _3: std::result::Result<u8, i32>; // in scope 0 at $DIR/simplify-arm.rs:36:19: 36:33
9       let mut _4: std::result::Result<u8, i32>; // in scope 0 at $DIR/simplify-arm.rs:36:31: 36:32
10       let mut _5: isize;                   // in scope 0 at $DIR/simplify-arm.rs:37:9: 37:15
11       let _6: i32;                         // in scope 0 at $DIR/simplify-arm.rs:37:13: 37:14
12       let mut _7: !;                       // in scope 0 at $DIR/simplify-arm.rs:37:19: 37:51
13       let mut _8: i32;                     // in scope 0 at $DIR/simplify-arm.rs:37:37: 37:50
14       let mut _9: i32;                     // in scope 0 at $DIR/simplify-arm.rs:37:48: 37:49
15       let _10: u8;                         // in scope 0 at $DIR/simplify-arm.rs:38:12: 38:13
16       let mut _11: u8;                     // in scope 0 at $DIR/simplify-arm.rs:40:8: 40:9
17       scope 1 {
18           debug x => ((_0 as Ok).0: u8);   // in scope 1 at $DIR/simplify-arm.rs:36:9: 36:10
19       }
20       scope 2 {
21           debug e => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify-arm.rs:37:13: 37:14
22           scope 5 (inlined <i32 as From<i32>>::from) { // at $DIR/simplify-arm.rs:37:37: 37:50
23               debug t => ((_0 as Err).0: i32); // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
24           }
25           scope 6 (inlined from_error::<u8, i32>) { // at $DIR/simplify-arm.rs:37:26: 37:51
26               debug e => ((_0 as Err).0: i32); // in scope 6 at $DIR/simplify-arm.rs:27:21: 27:22
27           }
28       }
29       scope 3 {
30           debug v => ((_0 as Ok).0: u8);   // in scope 3 at $DIR/simplify-arm.rs:38:12: 38:13
31       }
32       scope 4 (inlined into_result::<u8, i32>) { // at $DIR/simplify-arm.rs:36:19: 36:33
33           debug r => _4;                   // in scope 4 at $DIR/simplify-arm.rs:23:22: 23:23
34       }
35   
36       bb0: {
37           StorageLive(_2);                 // scope 0 at $DIR/simplify-arm.rs:36:9: 36:10
38           StorageLive(_3);                 // scope 0 at $DIR/simplify-arm.rs:36:19: 36:33
39           StorageLive(_4);                 // scope 0 at $DIR/simplify-arm.rs:36:31: 36:32
40           _4 = _1;                         // scope 0 at $DIR/simplify-arm.rs:36:31: 36:32
41           _3 = move _4;                    // scope 4 at $DIR/simplify-arm.rs:24:5: 24:6
42           StorageDead(_4);                 // scope 0 at $DIR/simplify-arm.rs:36:32: 36:33
43           _5 = discriminant(_3);           // scope 0 at $DIR/simplify-arm.rs:36:19: 36:33
44 -         switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:36:13: 36:33
45 +         goto -> bb1;                     // scope 0 at $DIR/simplify-arm.rs:36:13: 36:33
46       }
47   
48       bb1: {
49           _0 = move _3;                    // scope 1 at $DIR/simplify-arm.rs:40:5: 40:10
50           StorageDead(_3);                 // scope 0 at $DIR/simplify-arm.rs:39:6: 39:7
51           StorageDead(_2);                 // scope 0 at $DIR/simplify-arm.rs:41:1: 41:2
52 -         goto -> bb4;                     // scope 0 at $DIR/simplify-arm.rs:41:2: 41:2
53 +         goto -> bb2;                     // scope 0 at $DIR/simplify-arm.rs:41:2: 41:2
54       }
55   
56       bb2: {
57 -         unreachable;                     // scope 0 at $DIR/simplify-arm.rs:36:19: 36:33
58 -     }
59
60 -     bb3: {
61 -         _0 = move _3;                    // scope 6 at $DIR/simplify-arm.rs:28:5: 28:11
62 -         StorageDead(_3);                 // scope 0 at $DIR/simplify-arm.rs:39:6: 39:7
63 -         StorageDead(_2);                 // scope 0 at $DIR/simplify-arm.rs:41:1: 41:2
64 -         goto -> bb4;                     // scope 0 at $DIR/simplify-arm.rs:41:2: 41:2
65 -     }
66
67 -     bb4: {
68           return;                          // scope 0 at $DIR/simplify-arm.rs:41:2: 41:2
69       }
70   }
71