2023-02-22 18:00:00 -06:00
|
|
|
- // MIR for `test` before ElaborateDrops
|
|
|
|
+ // MIR for `test` after ElaborateDrops
|
|
|
|
|
|
|
|
fn test() -> () {
|
2023-06-06 08:47:00 -05:00
|
|
|
let mut _0: ();
|
|
|
|
let _1: S;
|
|
|
|
let _3: ();
|
|
|
|
let mut _4: S;
|
|
|
|
let mut _5: S;
|
|
|
|
+ let mut _6: bool;
|
2023-02-22 18:00:00 -06:00
|
|
|
scope 1 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug u => _1;
|
|
|
|
let mut _2: S;
|
2023-02-22 18:00:00 -06:00
|
|
|
scope 2 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug v => _2;
|
2023-02-22 18:00:00 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
2023-06-06 08:47:00 -05:00
|
|
|
+ _6 = const false;
|
|
|
|
StorageLive(_1);
|
|
|
|
+ _6 = const true;
|
|
|
|
_1 = S;
|
|
|
|
StorageLive(_2);
|
|
|
|
_2 = S;
|
|
|
|
StorageLive(_3);
|
|
|
|
StorageLive(_4);
|
|
|
|
_4 = move _2;
|
|
|
|
_3 = std::mem::drop::<S>(move _4) -> [return: bb1, unwind: bb7];
|
2023-02-22 18:00:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_4);
|
|
|
|
StorageDead(_3);
|
|
|
|
StorageLive(_5);
|
|
|
|
+ _6 = const false;
|
|
|
|
_5 = move _1;
|
|
|
|
- drop(_2) -> [return: bb2, unwind: bb3];
|
|
|
|
+ goto -> bb2;
|
2023-02-22 18:00:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2023-06-06 08:47:00 -05:00
|
|
|
_2 = move _5;
|
|
|
|
- drop(_5) -> [return: bb4, unwind: bb8];
|
|
|
|
+ goto -> bb4;
|
2023-02-08 15:29:52 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb3 (cleanup): {
|
2023-06-06 08:47:00 -05:00
|
|
|
_2 = move _5;
|
2023-08-24 07:26:26 -05:00
|
|
|
- drop(_5) -> [return: bb8, unwind terminate(cleanup)];
|
2023-08-16 13:19:48 -05:00
|
|
|
+ goto -> bb8;
|
2023-02-22 18:00:00 -06:00
|
|
|
}
|
|
|
|
|
2023-02-08 15:29:52 -06:00
|
|
|
bb4: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_5);
|
|
|
|
_0 = const ();
|
|
|
|
drop(_2) -> [return: bb5, unwind: bb9];
|
2023-02-22 18:00:00 -06:00
|
|
|
}
|
|
|
|
|
2023-02-08 15:29:52 -06:00
|
|
|
bb5: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_2);
|
|
|
|
- drop(_1) -> [return: bb6, unwind: bb10];
|
|
|
|
+ goto -> bb6;
|
2023-02-22 18:00:00 -06:00
|
|
|
}
|
|
|
|
|
2023-02-08 15:29:52 -06:00
|
|
|
bb6: {
|
2023-06-06 08:47:00 -05:00
|
|
|
+ _6 = const false;
|
|
|
|
StorageDead(_1);
|
|
|
|
return;
|
2023-02-22 18:00:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb7 (cleanup): {
|
2023-08-24 07:26:26 -05:00
|
|
|
- drop(_4) -> [return: bb8, unwind terminate(cleanup)];
|
2023-06-06 08:47:00 -05:00
|
|
|
+ goto -> bb8;
|
2023-02-22 18:00:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb8 (cleanup): {
|
2023-08-24 07:26:26 -05:00
|
|
|
- drop(_2) -> [return: bb9, unwind terminate(cleanup)];
|
2023-06-06 08:47:00 -05:00
|
|
|
+ goto -> bb9;
|
2023-02-22 18:00:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb9 (cleanup): {
|
2023-08-24 07:26:26 -05:00
|
|
|
- drop(_1) -> [return: bb10, unwind terminate(cleanup)];
|
2023-05-06 02:57:05 -05:00
|
|
|
+ goto -> bb12;
|
2023-02-22 18:00:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb10 (cleanup): {
|
2023-06-06 08:47:00 -05:00
|
|
|
resume;
|
2023-02-22 18:00:00 -06:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ bb11 (cleanup): {
|
2023-08-24 07:26:26 -05:00
|
|
|
+ drop(_1) -> [return: bb10, unwind terminate(cleanup)];
|
2023-04-05 03:17:40 -05:00
|
|
|
+ }
|
|
|
|
+
|
2023-05-06 02:57:05 -05:00
|
|
|
+ bb12 (cleanup): {
|
|
|
|
+ switchInt(copy _6) -> [0: bb10, otherwise: bb11];
|
2023-02-22 18:00:00 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|