]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/simplify_arm.id_result.SimplifyBranchSame.diff
Auto merge of #83314 - Aaron1011:print-unstable-value, r=lcnr
[rust.git] / src / test / mir-opt / simplify_arm.id_result.SimplifyBranchSame.diff
1 - // MIR for `id_result` before SimplifyBranchSame
2 + // MIR for `id_result` after SimplifyBranchSame
3   
4   fn id_result(_1: Result<u8, i32>) -> Result<u8, i32> {
5       debug r => _1;                       // in scope 0 at $DIR/simplify-arm.rs:16:14: 16:15
6       let mut _0: std::result::Result<u8, i32>; // return place in scope 0 at $DIR/simplify-arm.rs:16:37: 16:52
7       let mut _2: isize;                   // in scope 0 at $DIR/simplify-arm.rs:18:9: 18:14
8       let _3: u8;                          // in scope 0 at $DIR/simplify-arm.rs:18:12: 18:13
9       let mut _4: u8;                      // in scope 0 at $DIR/simplify-arm.rs:18:21: 18:22
10       let _5: i32;                         // in scope 0 at $DIR/simplify-arm.rs:19:13: 19:14
11       let mut _6: i32;                     // in scope 0 at $DIR/simplify-arm.rs:19:23: 19:24
12       scope 1 {
13           debug x => ((_0 as Ok).0: u8);   // in scope 1 at $DIR/simplify-arm.rs:18:12: 18:13
14       }
15       scope 2 {
16           debug y => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify-arm.rs:19:13: 19:14
17       }
18   
19       bb0: {
20           _2 = discriminant(_1);           // scope 0 at $DIR/simplify-arm.rs:18:9: 18:14
21 -         switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:18:9: 18:14
22 +         goto -> bb1;                     // scope 0 at $DIR/simplify-arm.rs:18:9: 18:14
23       }
24   
25       bb1: {
26 -         _0 = move _1;                    // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25
27 -         goto -> bb4;                     // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
28 -     }
29
30 -     bb2: {
31 -         unreachable;                     // scope 0 at $DIR/simplify-arm.rs:17:11: 17:12
32 -     }
33
34 -     bb3: {
35           _0 = move _1;                    // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23
36 -         goto -> bb4;                     // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
37 +         goto -> bb2;                     // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
38       }
39   
40 -     bb4: {
41 +     bb2: {
42           return;                          // scope 0 at $DIR/simplify-arm.rs:21:2: 21:2
43       }
44   }
45