ad7f109bfa
Each pattern in a match arm has its own copy of the match guard in MIR, with its own temporary, so it has to be dropped before the the guards are joined to the single copy of the arm.
273 lines
16 KiB
Diff
273 lines
16 KiB
Diff
- // MIR for `complicated_match` after SimplifyCfg-initial
|
|
+ // MIR for `complicated_match` after ElaborateDrops
|
|
|
|
fn complicated_match(_1: bool, _2: (bool, bool, String)) -> i32 {
|
|
debug cond => _1; // in scope 0 at $DIR/match-arm-scopes.rs:13:22: 13:26
|
|
debug items => _2; // in scope 0 at $DIR/match-arm-scopes.rs:13:34: 13:39
|
|
let mut _0: i32; // return place in scope 0 at $DIR/match-arm-scopes.rs:13:66: 13:69
|
|
let mut _3: &bool; // in scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16
|
|
let mut _4: &bool; // in scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16
|
|
let _5: bool; // in scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
|
let _6: &bool; // in scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
|
let _7: std::string::String; // in scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
|
let _8: &std::string::String; // in scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
|
let mut _9: bool; // in scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
|
let mut _10: bool; // in scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49
|
|
let mut _11: !; // in scope 0 at $DIR/match-arm-scopes.rs:15:52: 15:60
|
|
let mut _12: bool; // in scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
|
let mut _13: bool; // in scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49
|
|
let mut _14: !; // in scope 0 at $DIR/match-arm-scopes.rs:15:52: 15:60
|
|
let _15: bool; // in scope 0 at $DIR/match-arm-scopes.rs:16:16: 16:17
|
|
let _16: std::string::String; // in scope 0 at $DIR/match-arm-scopes.rs:16:19: 16:20
|
|
scope 1 {
|
|
debug a => _5; // in scope 1 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
|
debug a => _6; // in scope 1 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
|
debug s => _7; // in scope 1 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
|
debug s => _8; // in scope 1 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
|
}
|
|
scope 2 {
|
|
debug b => _15; // in scope 2 at $DIR/match-arm-scopes.rs:16:16: 16:17
|
|
debug t => _16; // in scope 2 at $DIR/match-arm-scopes.rs:16:19: 16:20
|
|
}
|
|
|
|
bb0: {
|
|
- FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16
|
|
- switchInt((_2.0: bool)) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 14:16
|
|
+ switchInt((_2.0: bool)) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 14:16
|
|
}
|
|
|
|
bb1: {
|
|
- falseEdge -> [real: bb8, imaginary: bb3]; // scope 0 at $DIR/match-arm-scopes.rs:15:9: 15:22
|
|
+ switchInt((_2.1: bool)) -> [false: bb10, otherwise: bb2]; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 14:16
|
|
}
|
|
|
|
bb2: {
|
|
- switchInt((_2.1: bool)) -> [false: bb3, otherwise: bb4]; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 14:16
|
|
+ switchInt((_2.0: bool)) -> [false: bb3, otherwise: bb17]; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 14:16
|
|
}
|
|
|
|
bb3: {
|
|
- falseEdge -> [real: bb13, imaginary: bb5]; // scope 0 at $DIR/match-arm-scopes.rs:15:25: 15:38
|
|
- }
|
|
-
|
|
- bb4: {
|
|
- switchInt((_2.0: bool)) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 14:16
|
|
- }
|
|
-
|
|
- bb5: {
|
|
- falseEdge -> [real: bb20, imaginary: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:16:9: 16:21
|
|
- }
|
|
-
|
|
- bb6: {
|
|
StorageLive(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:32: 16:33
|
|
_15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:32: 16:33
|
|
StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:35: 16:36
|
|
_16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:35: 16:36
|
|
- goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
|
+ goto -> bb16; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
|
}
|
|
|
|
- bb7: {
|
|
+ bb4: {
|
|
_0 = const 1_i32; // scope 1 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
- drop(_7) -> [return: bb18, unwind: bb25]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
+ drop(_7) -> [return: bb15, unwind: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
}
|
|
|
|
- bb8: {
|
|
+ bb5: {
|
|
StorageLive(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
|
_6 = &(_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
|
StorageLive(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
|
_8 = &(_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
|
- _3 = &shallow (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16
|
|
- _4 = &shallow (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16
|
|
StorageLive(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
|
StorageLive(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49
|
|
_10 = _1; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49
|
|
- switchInt(move _10) -> [false: bb10, otherwise: bb9]; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49
|
|
+ switchInt(move _10) -> [false: bb7, otherwise: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49
|
|
}
|
|
|
|
- bb9: {
|
|
+ bb6: {
|
|
_0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60
|
|
StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
- goto -> bb23; // scope 0 at no-location
|
|
+ goto -> bb20; // scope 0 at no-location
|
|
}
|
|
|
|
- bb10: {
|
|
+ bb7: {
|
|
_9 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:15:70: 15:71
|
|
- switchInt(move _9) -> [false: bb12, otherwise: bb11]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
|
+ switchInt(move _9) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
|
}
|
|
|
|
- bb11: {
|
|
+ bb8: {
|
|
StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
- FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
- FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
- FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
- FakeRead(ForGuardBinding, _8); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
StorageLive(_5); // scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
|
_5 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
|
StorageLive(_7); // scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
|
_7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
|
- goto -> bb7; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
|
+ goto -> bb4; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
|
}
|
|
|
|
- bb12: {
|
|
+ bb9: {
|
|
StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
- falseEdge -> [real: bb2, imaginary: bb3]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
|
+ goto -> bb1; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
|
}
|
|
|
|
- bb13: {
|
|
+ bb10: {
|
|
StorageLive(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27
|
|
_6 = &(_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27
|
|
StorageLive(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:36: 15:37
|
|
_8 = &(_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:15:36: 15:37
|
|
- _3 = &shallow (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16
|
|
- _4 = &shallow (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16
|
|
StorageLive(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
|
StorageLive(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49
|
|
_13 = _1; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49
|
|
- switchInt(move _13) -> [false: bb15, otherwise: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49
|
|
+ switchInt(move _13) -> [false: bb12, otherwise: bb11]; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49
|
|
}
|
|
|
|
- bb14: {
|
|
+ bb11: {
|
|
_0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60
|
|
StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
- goto -> bb23; // scope 0 at no-location
|
|
+ goto -> bb20; // scope 0 at no-location
|
|
}
|
|
|
|
- bb15: {
|
|
+ bb12: {
|
|
_12 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:15:70: 15:71
|
|
- switchInt(move _12) -> [false: bb17, otherwise: bb16]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
|
+ switchInt(move _12) -> [false: bb14, otherwise: bb13]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
|
}
|
|
|
|
- bb16: {
|
|
+ bb13: {
|
|
StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
- FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
- FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
- FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
- FakeRead(ForGuardBinding, _8); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
StorageLive(_5); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27
|
|
_5 = (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27
|
|
StorageLive(_7); // scope 0 at $DIR/match-arm-scopes.rs:15:36: 15:37
|
|
_7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:15:36: 15:37
|
|
- goto -> bb7; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
|
+ goto -> bb4; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
|
}
|
|
|
|
- bb17: {
|
|
+ bb14: {
|
|
StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
- falseEdge -> [real: bb4, imaginary: bb5]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
|
+ goto -> bb2; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
|
}
|
|
|
|
- bb18: {
|
|
+ bb15: {
|
|
StorageDead(_7); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
StorageDead(_5); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
- goto -> bb22; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
+ goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
}
|
|
|
|
- bb19: {
|
|
+ bb16: {
|
|
_0 = const 2_i32; // scope 2 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
|
- drop(_16) -> [return: bb21, unwind: bb25]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
|
+ drop(_16) -> [return: bb18, unwind: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
|
}
|
|
|
|
- bb20: {
|
|
+ bb17: {
|
|
StorageLive(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:16: 16:17
|
|
_15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:16: 16:17
|
|
StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:19: 16:20
|
|
_16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:19: 16:20
|
|
- goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
|
+ goto -> bb16; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
|
}
|
|
|
|
- bb21: {
|
|
+ bb18: {
|
|
StorageDead(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
|
StorageDead(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
|
- goto -> bb22; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
|
+ goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
|
}
|
|
|
|
- bb22: {
|
|
- drop(_2) -> [return: bb24, unwind: bb26]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2
|
|
+ bb19: {
|
|
+ goto -> bb26; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2
|
|
}
|
|
|
|
- bb23: {
|
|
+ bb20: {
|
|
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
- drop(_2) -> [return: bb24, unwind: bb26]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2
|
|
+ drop(_2) -> [return: bb21, unwind: bb23]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2
|
|
}
|
|
|
|
- bb24: {
|
|
+ bb21: {
|
|
return; // scope 0 at $DIR/match-arm-scopes.rs:18:2: 18:2
|
|
}
|
|
|
|
- bb25 (cleanup): {
|
|
- drop(_2) -> bb26; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2
|
|
+ bb22 (cleanup): {
|
|
+ goto -> bb27; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2
|
|
}
|
|
|
|
- bb26 (cleanup): {
|
|
+ bb23 (cleanup): {
|
|
resume; // scope 0 at $DIR/match-arm-scopes.rs:13:1: 18:2
|
|
+ }
|
|
+
|
|
+ bb24: {
|
|
+ goto -> bb21; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2
|
|
+ }
|
|
+
|
|
+ bb25 (cleanup): {
|
|
+ goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2
|
|
+ }
|
|
+
|
|
+ bb26: {
|
|
+ goto -> bb24; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2
|
|
+ }
|
|
+
|
|
+ bb27 (cleanup): {
|
|
+ goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2
|
|
}
|
|
}
|
|
|