2020-11-10 18:00:00 -06:00
|
|
|
- // MIR for `main` before Inline
|
|
|
|
+ // MIR for `main` after Inline
|
|
|
|
|
|
|
|
fn main() -> () {
|
2023-06-06 08:47:00 -05:00
|
|
|
let mut _0: ();
|
2023-10-19 11:06:43 -05:00
|
|
|
let _1: std::ops::CoroutineState<i32, bool>;
|
2024-04-11 08:15:34 -05:00
|
|
|
let mut _2: std::pin::Pin<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}>;
|
|
|
|
let mut _3: &mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8};
|
|
|
|
let mut _4: {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8};
|
2023-10-03 05:19:00 -05:00
|
|
|
+ let mut _5: bool;
|
2020-11-10 18:00:00 -06:00
|
|
|
scope 1 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug _r => _1;
|
2020-11-10 18:00:00 -06:00
|
|
|
}
|
2023-06-06 08:47:00 -05:00
|
|
|
+ scope 2 (inlined g) {
|
2020-11-10 18:00:00 -06:00
|
|
|
+ }
|
2024-04-11 08:15:34 -05:00
|
|
|
+ scope 3 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}>::new) {
|
2023-06-06 08:47:00 -05:00
|
|
|
+ debug pointer => _3;
|
2024-04-11 08:15:34 -05:00
|
|
|
+ scope 4 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}>::new_unchecked) {
|
2024-02-27 05:57:52 -06:00
|
|
|
+ debug pointer => _3;
|
2020-11-10 18:00:00 -06:00
|
|
|
+ }
|
|
|
|
+ }
|
2024-02-27 05:57:52 -06:00
|
|
|
+ scope 5 (inlined g::{closure#0}) {
|
2023-10-03 05:19:00 -05:00
|
|
|
+ debug a => _5;
|
2024-04-11 08:15:34 -05:00
|
|
|
+ let mut _6: &mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8};
|
2023-10-03 05:19:00 -05:00
|
|
|
+ let mut _7: u32;
|
|
|
|
+ let mut _8: i32;
|
2020-11-10 18:00:00 -06:00
|
|
|
+ }
|
|
|
|
|
|
|
|
bb0: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_1);
|
|
|
|
StorageLive(_2);
|
|
|
|
StorageLive(_3);
|
|
|
|
StorageLive(_4);
|
2023-06-23 11:53:09 -05:00
|
|
|
- _4 = g() -> [return: bb1, unwind continue];
|
2024-04-11 08:15:34 -05:00
|
|
|
+ _4 = {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8 (#0)};
|
2023-11-18 18:00:00 -06:00
|
|
|
+ _3 = &mut _4;
|
2024-04-11 08:15:34 -05:00
|
|
|
+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}> { __pointer: copy _3 };
|
2023-11-18 18:00:00 -06:00
|
|
|
+ StorageDead(_3);
|
2023-10-03 05:19:00 -05:00
|
|
|
+ StorageLive(_5);
|
|
|
|
+ _5 = const false;
|
2023-09-30 05:44:31 -05:00
|
|
|
+ StorageLive(_6);
|
2023-10-04 12:50:03 -05:00
|
|
|
+ StorageLive(_7);
|
2024-04-11 08:15:34 -05:00
|
|
|
+ _6 = copy (_2.0: &mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8});
|
2023-10-03 05:19:00 -05:00
|
|
|
+ _7 = discriminant((*_6));
|
|
|
|
+ switchInt(move _7) -> [0: bb5, 1: bb9, 3: bb10, otherwise: bb11];
|
2020-11-10 18:00:00 -06:00
|
|
|
}
|
|
|
|
|
2023-11-18 18:00:00 -06:00
|
|
|
bb1: {
|
|
|
|
- _3 = &mut _4;
|
2024-04-11 08:15:34 -05:00
|
|
|
- _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}>::new(move _3) -> [return: bb2, unwind: bb5];
|
2023-11-18 18:00:00 -06:00
|
|
|
+ StorageDead(_4);
|
|
|
|
+ _0 = const ();
|
|
|
|
+ StorageDead(_1);
|
|
|
|
+ return;
|
|
|
|
}
|
|
|
|
|
|
|
|
- bb2: {
|
|
|
|
- StorageDead(_3);
|
2024-04-11 08:15:34 -05:00
|
|
|
- _1 = <{coroutine@$DIR/inline_coroutine.rs:20:5: 20:8} as Coroutine<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb5];
|
2023-11-18 18:00:00 -06:00
|
|
|
+ bb2 (cleanup): {
|
|
|
|
+ drop(_4) -> [return: bb3, unwind terminate(cleanup)];
|
|
|
|
}
|
|
|
|
|
2020-11-10 18:00:00 -06:00
|
|
|
- bb3: {
|
2023-11-18 18:00:00 -06:00
|
|
|
- StorageDead(_2);
|
2023-01-28 12:49:48 -06:00
|
|
|
- drop(_4) -> [return: bb4, unwind: bb6];
|
2023-11-18 18:00:00 -06:00
|
|
|
+ bb3 (cleanup): {
|
|
|
|
+ resume;
|
2023-01-28 12:49:48 -06:00
|
|
|
}
|
|
|
|
|
2023-11-18 18:00:00 -06:00
|
|
|
bb4: {
|
|
|
|
- StorageDead(_4);
|
|
|
|
- _0 = const ();
|
|
|
|
- StorageDead(_1);
|
|
|
|
- return;
|
|
|
|
+ StorageDead(_7);
|
|
|
|
+ StorageDead(_6);
|
|
|
|
+ StorageDead(_5);
|
|
|
|
+ StorageDead(_2);
|
|
|
|
+ drop(_4) -> [return: bb1, unwind: bb3];
|
2020-11-10 18:00:00 -06:00
|
|
|
}
|
|
|
|
|
2023-01-28 12:49:48 -06:00
|
|
|
- bb5 (cleanup): {
|
|
|
|
- drop(_4) -> [return: bb6, unwind terminate(cleanup)];
|
|
|
|
+ bb5: {
|
2023-10-03 05:19:00 -05:00
|
|
|
+ StorageLive(_8);
|
|
|
|
+ switchInt(copy _5) -> [0: bb6, otherwise: bb7];
|
2023-11-18 18:00:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
- bb6 (cleanup): {
|
|
|
|
- resume;
|
2023-01-28 12:49:48 -06:00
|
|
|
+ bb6: {
|
2023-10-03 05:19:00 -05:00
|
|
|
+ _8 = const 13_i32;
|
2023-01-28 12:49:48 -06:00
|
|
|
+ goto -> bb8;
|
2020-11-10 18:00:00 -06:00
|
|
|
+ }
|
|
|
|
+
|
2023-01-28 12:49:48 -06:00
|
|
|
+ bb7: {
|
2023-10-03 05:19:00 -05:00
|
|
|
+ _8 = const 7_i32;
|
2023-01-28 12:49:48 -06:00
|
|
|
+ goto -> bb8;
|
2020-11-10 18:00:00 -06:00
|
|
|
+ }
|
|
|
|
+
|
2023-01-28 12:49:48 -06:00
|
|
|
+ bb8: {
|
2023-10-19 11:06:43 -05:00
|
|
|
+ _1 = CoroutineState::<i32, bool>::Yielded(move _8);
|
2023-12-08 18:00:00 -06:00
|
|
|
+ StorageDead(_8);
|
2023-10-03 05:19:00 -05:00
|
|
|
+ discriminant((*_6)) = 3;
|
2023-11-18 18:00:00 -06:00
|
|
|
+ goto -> bb4;
|
2020-11-10 18:00:00 -06:00
|
|
|
+ }
|
|
|
|
+
|
2023-01-28 12:49:48 -06:00
|
|
|
+ bb9: {
|
2023-11-18 18:00:00 -06:00
|
|
|
+ assert(const false, "coroutine resumed after completion") -> [success: bb9, unwind: bb2];
|
2023-05-21 13:44:37 -05:00
|
|
|
+ }
|
|
|
|
+
|
2023-01-28 12:49:48 -06:00
|
|
|
+ bb10: {
|
2023-10-03 05:19:00 -05:00
|
|
|
+ StorageLive(_8);
|
|
|
|
+ StorageDead(_8);
|
2023-10-19 11:06:43 -05:00
|
|
|
+ _1 = CoroutineState::<i32, bool>::Complete(copy _5);
|
2023-10-03 05:19:00 -05:00
|
|
|
+ discriminant((*_6)) = 1;
|
2023-11-18 18:00:00 -06:00
|
|
|
+ goto -> bb4;
|
2020-11-10 18:00:00 -06:00
|
|
|
+ }
|
|
|
|
+
|
2023-01-28 12:49:48 -06:00
|
|
|
+ bb11: {
|
2023-06-06 08:47:00 -05:00
|
|
|
+ unreachable;
|
2020-11-10 18:00:00 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|