2020-08-31 12:11:44 -05:00
|
|
|
// MIR for `main::{closure#0}` 0 generator_resume
|
2020-06-19 22:19:19 -05:00
|
|
|
/* generator_layout = GeneratorLayout {
|
2022-04-05 18:02:57 -05:00
|
|
|
field_tys: {
|
2022-09-11 10:24:53 -05:00
|
|
|
_0: GeneratorSavedTy {
|
|
|
|
ty: HasDrop,
|
|
|
|
source_info: SourceInfo {
|
|
|
|
span: $DIR/generator_tiny.rs:20:13: 20:15 (#0),
|
|
|
|
scope: scope[0],
|
|
|
|
},
|
2023-01-21 08:26:44 -06:00
|
|
|
ignore_for_traits: false,
|
2022-09-11 10:24:53 -05:00
|
|
|
},
|
2022-04-05 18:02:57 -05:00
|
|
|
},
|
2020-06-19 22:19:19 -05:00
|
|
|
variant_fields: {
|
|
|
|
Unresumed(0): [],
|
|
|
|
Returned (1): [],
|
|
|
|
Panicked (2): [],
|
2022-04-05 18:02:57 -05:00
|
|
|
Suspend0 (3): [_0],
|
|
|
|
},
|
|
|
|
storage_conflicts: BitMatrix(1x1) {
|
|
|
|
(_0, _0),
|
2020-06-19 22:19:19 -05:00
|
|
|
},
|
|
|
|
} */
|
2020-04-02 16:09:01 -05:00
|
|
|
|
2022-11-02 16:54:49 -05:00
|
|
|
fn main::{closure#0}(_1: Pin<&mut [generator@$DIR/generator_tiny.rs:19:16: 19:24]>, _2: u8) -> GeneratorState<(), ()> {
|
|
|
|
debug _x => _10; // in scope 0 at $DIR/generator_tiny.rs:+0:17: +0:19
|
|
|
|
let mut _0: std::ops::GeneratorState<(), ()>; // return place in scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
|
|
|
|
let _3: HasDrop; // in scope 0 at $DIR/generator_tiny.rs:+1:13: +1:15
|
|
|
|
let mut _4: !; // in scope 0 at $DIR/generator_tiny.rs:+2:9: +5:10
|
|
|
|
let mut _5: (); // in scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
|
|
|
|
let _6: u8; // in scope 0 at $DIR/generator_tiny.rs:+3:13: +3:18
|
|
|
|
let mut _7: (); // in scope 0 at $DIR/generator_tiny.rs:+3:13: +3:18
|
|
|
|
let _8: (); // in scope 0 at $DIR/generator_tiny.rs:+4:13: +4:21
|
|
|
|
let mut _9: (); // in scope 0 at $DIR/generator_tiny.rs:+0:25: +0:25
|
|
|
|
let _10: u8; // in scope 0 at $DIR/generator_tiny.rs:+0:17: +0:19
|
|
|
|
let mut _11: u32; // in scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
|
2020-04-02 16:09:01 -05:00
|
|
|
scope 1 {
|
2022-11-02 16:54:49 -05:00
|
|
|
debug _d => (((*(_1.0: &mut [generator@$DIR/generator_tiny.rs:19:16: 19:24])) as variant#3).0: HasDrop); // in scope 1 at $DIR/generator_tiny.rs:+1:13: +1:15
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
2022-11-02 16:54:49 -05:00
|
|
|
_11 = discriminant((*(_1.0: &mut [generator@$DIR/generator_tiny.rs:19:16: 19:24]))); // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
|
2022-12-03 18:03:27 -06:00
|
|
|
switchInt(move _11) -> [0: bb1, 3: bb5, otherwise: bb6]; // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2022-11-02 16:54:49 -05:00
|
|
|
_10 = move _2; // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
|
|
|
|
nop; // scope 0 at $DIR/generator_tiny.rs:+1:13: +1:15
|
|
|
|
(((*(_1.0: &mut [generator@$DIR/generator_tiny.rs:19:16: 19:24])) as variant#3).0: HasDrop) = HasDrop; // scope 0 at $DIR/generator_tiny.rs:+1:18: +1:25
|
|
|
|
StorageLive(_4); // scope 1 at $DIR/generator_tiny.rs:+2:9: +5:10
|
|
|
|
goto -> bb2; // scope 1 at $DIR/generator_tiny.rs:+2:9: +5:10
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2022-11-02 16:54:49 -05:00
|
|
|
StorageLive(_6); // scope 1 at $DIR/generator_tiny.rs:+3:13: +3:18
|
|
|
|
StorageLive(_7); // scope 1 at $DIR/generator_tiny.rs:+3:13: +3:18
|
|
|
|
_7 = (); // scope 1 at $DIR/generator_tiny.rs:+3:13: +3:18
|
2023-01-25 12:34:19 -06:00
|
|
|
_0 = GeneratorState::<(), ()>::Yielded(move _7); // scope 1 at $DIR/generator_tiny.rs:+3:13: +3:18
|
2022-11-02 16:54:49 -05:00
|
|
|
discriminant((*(_1.0: &mut [generator@$DIR/generator_tiny.rs:19:16: 19:24]))) = 3; // scope 1 at $DIR/generator_tiny.rs:+3:13: +3:18
|
|
|
|
return; // scope 1 at $DIR/generator_tiny.rs:+3:13: +3:18
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb3: {
|
2022-11-02 16:54:49 -05:00
|
|
|
StorageDead(_7); // scope 1 at $DIR/generator_tiny.rs:+3:17: +3:18
|
|
|
|
StorageDead(_6); // scope 1 at $DIR/generator_tiny.rs:+3:18: +3:19
|
|
|
|
StorageLive(_8); // scope 1 at $DIR/generator_tiny.rs:+4:13: +4:21
|
|
|
|
_8 = callee() -> bb4; // scope 1 at $DIR/generator_tiny.rs:+4:13: +4:21
|
2020-04-02 16:09:01 -05:00
|
|
|
// mir::Constant
|
2022-11-02 16:54:49 -05:00
|
|
|
// + span: $DIR/generator_tiny.rs:23:13: 23:19
|
2022-07-06 09:14:46 -05:00
|
|
|
// + literal: Const { ty: fn() {callee}, val: Value(<ZST>) }
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb4: {
|
2022-11-02 16:54:49 -05:00
|
|
|
StorageDead(_8); // scope 1 at $DIR/generator_tiny.rs:+4:21: +4:22
|
|
|
|
_5 = const (); // scope 1 at $DIR/generator_tiny.rs:+2:14: +5:10
|
|
|
|
goto -> bb2; // scope 1 at $DIR/generator_tiny.rs:+2:9: +5:10
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb5: {
|
2022-11-02 16:54:49 -05:00
|
|
|
StorageLive(_4); // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
|
|
|
|
StorageLive(_6); // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
|
|
|
|
StorageLive(_7); // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
|
|
|
|
_6 = move _2; // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
|
|
|
|
goto -> bb3; // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb6: {
|
2022-11-02 16:54:49 -05:00
|
|
|
unreachable; // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
}
|