|
| 1 | +- // MIR for `flip_flop` before MatchBranchSimplification |
| 2 | ++ // MIR for `flip_flop` after MatchBranchSimplification |
| 3 | + |
| 4 | + fn flip_flop(_1: std::result::Result<i32, u32>) -> std::result::Result<u32, i32> { |
| 5 | + debug a => _1; // in scope 0 at $DIR/match_identity.rs:16:18: 16:19 |
| 6 | + let mut _0: std::result::Result<u32, i32>; // return place in scope 0 at $DIR/match_identity.rs:16:38: 16:50 |
| 7 | + let mut _2: isize; // in scope 0 at $DIR/match_identity.rs:18:9: 18:14 |
| 8 | + let _3: i32; // in scope 0 at $DIR/match_identity.rs:18:12: 18:13 |
| 9 | + let mut _4: i32; // in scope 0 at $DIR/match_identity.rs:18:22: 18:23 |
| 10 | + let _5: u32; // in scope 0 at $DIR/match_identity.rs:19:13: 19:14 |
| 11 | + let mut _6: u32; // in scope 0 at $DIR/match_identity.rs:19:22: 19:23 |
| 12 | + scope 1 { |
| 13 | + debug x => _3; // in scope 1 at $DIR/match_identity.rs:18:12: 18:13 |
| 14 | + } |
| 15 | + scope 2 { |
| 16 | + debug y => _5; // in scope 2 at $DIR/match_identity.rs:19:13: 19:14 |
| 17 | + } |
| 18 | + |
| 19 | + bb0: { |
| 20 | + _2 = discriminant(_1); // scope 0 at $DIR/match_identity.rs:18:9: 18:14 |
| 21 | + switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/match_identity.rs:18:9: 18:14 |
| 22 | + } |
| 23 | + |
| 24 | + bb1: { |
| 25 | + StorageLive(_5); // scope 0 at $DIR/match_identity.rs:19:13: 19:14 |
| 26 | + _5 = ((_1 as Err).0: u32); // scope 0 at $DIR/match_identity.rs:19:13: 19:14 |
| 27 | + StorageLive(_6); // scope 2 at $DIR/match_identity.rs:19:22: 19:23 |
| 28 | + _6 = _5; // scope 2 at $DIR/match_identity.rs:19:22: 19:23 |
| 29 | + ((_0 as Ok).0: u32) = move _6; // scope 2 at $DIR/match_identity.rs:19:19: 19:24 |
| 30 | + discriminant(_0) = 0; // scope 2 at $DIR/match_identity.rs:19:19: 19:24 |
| 31 | + StorageDead(_6); // scope 2 at $DIR/match_identity.rs:19:23: 19:24 |
| 32 | + StorageDead(_5); // scope 0 at $DIR/match_identity.rs:19:23: 19:24 |
| 33 | + goto -> bb3; // scope 0 at $DIR/match_identity.rs:17:5: 20:6 |
| 34 | + } |
| 35 | + |
| 36 | + bb2: { |
| 37 | + StorageLive(_3); // scope 0 at $DIR/match_identity.rs:18:12: 18:13 |
| 38 | + _3 = ((_1 as Ok).0: i32); // scope 0 at $DIR/match_identity.rs:18:12: 18:13 |
| 39 | + StorageLive(_4); // scope 1 at $DIR/match_identity.rs:18:22: 18:23 |
| 40 | + _4 = _3; // scope 1 at $DIR/match_identity.rs:18:22: 18:23 |
| 41 | + ((_0 as Err).0: i32) = move _4; // scope 1 at $DIR/match_identity.rs:18:18: 18:24 |
| 42 | + discriminant(_0) = 1; // scope 1 at $DIR/match_identity.rs:18:18: 18:24 |
| 43 | + StorageDead(_4); // scope 1 at $DIR/match_identity.rs:18:23: 18:24 |
| 44 | + StorageDead(_3); // scope 0 at $DIR/match_identity.rs:18:23: 18:24 |
| 45 | + goto -> bb3; // scope 0 at $DIR/match_identity.rs:17:5: 20:6 |
| 46 | + } |
| 47 | + |
| 48 | + bb3: { |
| 49 | + return; // scope 0 at $DIR/match_identity.rs:21:2: 21:2 |
| 50 | + } |
| 51 | + } |
| 52 | + |
0 commit comments