Skip to content

Instantly share code, notes, and snippets.

@Nemo157
Last active March 11, 2019 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nemo157/b46ab3d5d7527b691f15d3665b8a88b2 to your computer and use it in GitHub Desktop.
Save Nemo157/b46ab3d5d7527b691f15d3665b8a88b2 to your computer and use it in GitHub Desktop.
// MIR for `composed::{{closure}}`
// source = MirSource { instance: Item(DefId(0/1:14 ~ foo[16c4]::composed[0]::{{closure}}[0])), promoted: None }
// pass_name = generator_drop
// disambiguator = 0
// generator_layout = GeneratorLayout { fields: [LocalDecl { mutability: Not, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutImmutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:11:17: 11:27)), pat_span: src/main.rs:11:9: 11:14 }))), internal: false, is_block_tail: None, ty: impl std::future::Future, user_ty: UserTypeProjections { contents: [] }, name: Some(inner), source_info: SourceInfo { span: src/main.rs:11:9: 11:14, scope: scope[2] }, visibility_scope: scope[1] }, LocalDecl { mutability: Mut, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutMutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:13:12: 13:17)), pat_span: <::std::macros::await macros>:3:5: 3:15 }))), internal: false, is_block_tail: None, ty: impl std::future::Future, user_ty: UserTypeProjections { contents: [] }, name: Some(pinned), source_info: SourceInfo { span: <::std::macros::await macros>:3:5: 3:15, scope: scope[6] }, visibility_scope: scope[5] }] }
| User Type Annotations
| 0: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }, CanonicalVarInfo { kind: Ty(General(U0)) }], value: TypeOf(DefId(2/0:1875 ~ core[ae7c]::pin[0]::{{impl}}[3]::new_unchecked[0]), UserSubsts { substs: [^0], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2/0:1874 ~ core[ae7c]::pin[0]::{{impl}}[3]), self_ty: std::pin::Pin<^1> }) }) } at <::std::macros::await macros>:6:10: 6:48
|
fn composed::{{closure}}(_1: *mut [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}]) -> () {
let mut _0: (); // return place
scope 1 {
scope 3 {
}
scope 4 {
let _4: &impl std::future::Future; // "_foo" in scope 4 at src/main.rs:12:11: 12:15
}
scope 5 {
let _13: bool; // "x" in scope 5 at <::std::macros::await macros>:4:43: 4:44
scope 7 {
}
scope 8 {
}
}
scope 6 {
}
}
scope 2 {
}
let mut _2: ();
let mut _3: ();
let mut _5: bool;
let mut _6: ();
let mut _7: ();
let mut _8: ();
let mut _9: std::task::Poll<bool>;
let mut _10: std::pin::Pin<&mut impl std::future::Future>;
let mut _11: &mut impl std::future::Future;
let mut _12: &mut impl std::future::Future;
let mut _14: isize;
let mut _15: !;
let mut _16: ();
let mut _17: ();
bb0: {
switchInt(((*_1).0: u32)) -> [0u32: bb7, 3u32: bb11, otherwise: bb12]; // bb0[0]: scope 0 at src/main.rs:10:21: 14:2
}
bb1: { // cleanup
resume; // bb1[0]: scope 0 at src/main.rs:10:21: 14:2
}
bb2: { // cleanup
goto -> bb8; // bb2[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb3: {
drop(((*_1).2: impl std::future::Future)) -> [return: bb4, unwind: bb2]; // bb3[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb4: {
goto -> bb9; // bb4[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb5: {
return; // bb5[0]: scope 0 at src/main.rs:10:21: 14:2
}
bb6: {
return; // bb6[0]: scope 0 at src/main.rs:10:21: 14:2
}
bb7: {
goto -> bb10; // bb7[0]: scope 0 at src/main.rs:10:21: 14:2
}
bb8: { // cleanup
goto -> bb1; // bb8[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb9: {
goto -> bb5; // bb9[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb10: { // cleanup
goto -> bb6; // bb10[0]: scope 0 at src/main.rs:10:21: 14:2
}
bb11: {
StorageLive(_16); // bb11[0]: scope 0 at src/main.rs:10:21: 14:2
goto -> bb3; // bb11[1]: scope 0 at src/main.rs:10:21: 14:2
}
bb12: {
return; // bb12[0]: scope 0 at src/main.rs:10:21: 14:2
}
}
// MIR for `composed::{{closure}}`
// source = MirSource { instance: Item(DefId(0/1:14 ~ foo[16c4]::composed[0]::{{closure}}[0])), promoted: None }
// pass_name = generator_post-transform
// disambiguator = 0
// generator_layout = GeneratorLayout { fields: [LocalDecl { mutability: Not, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutImmutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:11:17: 11:27)), pat_span: src/main.rs:11:9: 11:14 }))), internal: false, is_block_tail: None, ty: impl std::future::Future, user_ty: UserTypeProjections { contents: [] }, name: Some(inner), source_info: SourceInfo { span: src/main.rs:11:9: 11:14, scope: scope[2] }, visibility_scope: scope[1] }, LocalDecl { mutability: Mut, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutMutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:13:12: 13:17)), pat_span: <::std::macros::await macros>:3:5: 3:15 }))), internal: false, is_block_tail: None, ty: impl std::future::Future, user_ty: UserTypeProjections { contents: [] }, name: Some(pinned), source_info: SourceInfo { span: <::std::macros::await macros>:3:5: 3:15, scope: scope[6] }, visibility_scope: scope[5] }] }
| User Type Annotations
| 0: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }, CanonicalVarInfo { kind: Ty(General(U0)) }], value: TypeOf(DefId(2/0:1875 ~ core[ae7c]::pin[0]::{{impl}}[3]::new_unchecked[0]), UserSubsts { substs: [^0], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2/0:1874 ~ core[ae7c]::pin[0]::{{impl}}[3]), self_ty: std::pin::Pin<^1> }) }) } at <::std::macros::await macros>:6:10: 6:48
|
fn composed::{{closure}}(_1: [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}]) -> std::ops::GeneratorState<(), ()> {
let mut _0: std::ops::GeneratorState<(), ()>; // return place
scope 1 {
scope 3 {
}
scope 4 {
let _4: &impl std::future::Future; // "_foo" in scope 4 at src/main.rs:12:11: 12:15
}
scope 5 {
let _13: bool; // "x" in scope 5 at <::std::macros::await macros>:4:43: 4:44
scope 7 {
}
scope 8 {
}
}
scope 6 {
}
}
scope 2 {
}
let mut _2: ();
let mut _3: ();
let mut _5: bool;
let mut _6: ();
let mut _7: ();
let mut _8: ();
let mut _9: std::task::Poll<bool>;
let mut _10: std::pin::Pin<&mut impl std::future::Future>;
let mut _11: &mut impl std::future::Future;
let mut _12: &mut impl std::future::Future;
let mut _14: isize;
let mut _15: !;
let mut _16: ();
let mut _17: ();
bb0: {
nop; // bb0[0]: scope 0 at src/main.rs:11:9: 11:14
(_1.1: impl std::future::Future) = const i_am_1kb() -> [return: bb2, unwind: bb3]; // bb0[1]: scope 0 at src/main.rs:11:17: 11:27
// ty::Const
// + ty: fn() -> impl std::future::Future {i_am_1kb}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: src/main.rs:11:17: 11:25
// + ty: fn() -> impl std::future::Future {i_am_1kb}
// + literal: Evaluated(Const { ty: fn() -> impl std::future::Future {i_am_1kb}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb1: { // cleanup
resume; // bb1[0]: scope 0 at src/main.rs:10:21: 14:2
}
bb2: {
StorageLive(_4); // bb2[0]: scope 1 at src/main.rs:12:11: 12:15
_4 = &(_1.1: impl std::future::Future); // bb2[1]: scope 1 at src/main.rs:12:18: 12:24
_3 = (); // bb2[2]: scope 1 at src/main.rs:12:5: 12:27
StorageDead(_4); // bb2[3]: scope 1 at src/main.rs:12:26: 12:27
nop; // bb2[4]: scope 1 at <::std::macros::await macros>:3:5: 3:15
(_1.2: impl std::future::Future) = move (_1.1: impl std::future::Future); // bb2[5]: scope 1 at src/main.rs:13:12: 13:17
goto -> bb4; // bb2[6]: scope 5 at <::std::macros::await macros>:3:24: 7:20
}
bb3: { // cleanup
goto -> bb19; // bb3[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb4: {
StorageLive(_9); // bb4[0]: scope 5 at <::std::macros::await macros>:4:49: 6:69
StorageLive(_10); // bb4[1]: scope 5 at <::std::macros::await macros>:6:1: 6:67
StorageLive(_11); // bb4[2]: scope 7 at <::std::macros::await macros>:6:51: 6:63
StorageLive(_12); // bb4[3]: scope 7 at <::std::macros::await macros>:6:51: 6:63
_12 = &mut (_1.2: impl std::future::Future); // bb4[4]: scope 7 at <::std::macros::await macros>:6:51: 6:63
_11 = &mut (*_12); // bb4[5]: scope 7 at <::std::macros::await macros>:6:51: 6:63
_10 = const <std::pin::Pin<P>>::new_unchecked(move _11) -> [return: bb6, unwind: bb5]; // bb4[6]: scope 7 at <::std::macros::await macros>:6:10: 6:65
// ty::Const
// + ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::await macros>:6:10: 6:48
// + ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}
// + user_ty: UserType(0)
// + literal: Evaluated(Const { ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb5: { // cleanup
drop((_1.2: impl std::future::Future)) -> bb3; // bb5[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb6: {
StorageDead(_11); // bb6[0]: scope 7 at <::std::macros::await macros>:6:64: 6:65
_9 = const std::future::poll_with_tls_waker(move _10) -> [return: bb7, unwind: bb5]; // bb6[1]: scope 5 at <::std::macros::await macros>:4:49: 6:69
// ty::Const
// + ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::await macros>:4:49: 5:20
// + ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}
// + literal: Evaluated(Const { ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb7: {
StorageDead(_10); // bb7[0]: scope 5 at <::std::macros::await macros>:6:68: 6:69
_14 = discriminant(_9); // bb7[1]: scope 5 at <::std::macros::await macros>:4:8: 4:46
switchInt(move _14) -> [0isize: bb9, otherwise: bb8]; // bb7[2]: scope 5 at <::std::macros::await macros>:4:8: 4:46
}
bb8: {
_8 = (); // bb8[0]: scope 5 at <::std::macros::await macros>:4:1: 7:12
StorageDead(_13); // bb8[1]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_9); // bb8[2]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_12); // bb8[3]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageLive(_16); // bb8[4]: scope 5 at <::std::macros::await macros>:7:13: 7:18
_16 = (); // bb8[5]: scope 5 at <::std::macros::await macros>:7:13: 7:18
_0 = std::ops::GeneratorState<(), ()>::Yielded(move _16,); // bb8[6]: scope 5 at <::std::macros::await macros>:7:13: 7:18
(_1.0: u32) = const 3u32; // bb8[7]: scope 5 at <::std::macros::await macros>:7:13: 7:18
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 3 })
// mir::Constant
// + span: <::std::macros::await macros>:7:13: 7:18
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 3 }) })
return; // bb8[8]: scope 5 at <::std::macros::await macros>:7:13: 7:18
}
bb9: {
StorageLive(_13); // bb9[0]: scope 5 at <::std::macros::await macros>:4:43: 4:44
_13 = ((_9 as Ready).0: bool); // bb9[1]: scope 5 at <::std::macros::await macros>:4:43: 4:44
_5 = _13; // bb9[2]: scope 8 at <::std::macros::await macros>:7:7: 7:8
StorageDead(_13); // bb9[3]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_9); // bb9[4]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_12); // bb9[5]: scope 5 at <::std::macros::await macros>:7:11: 7:12
drop((_1.2: impl std::future::Future)) -> [return: bb15, unwind: bb3]; // bb9[6]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb10: {
_7 = (); // bb10[0]: scope 5 at <::std::macros::await macros>:7:13: 7:18
StorageDead(_16); // bb10[1]: scope 5 at <::std::macros::await macros>:7:17: 7:18
goto -> bb4; // bb10[2]: scope 5 at <::std::macros::await macros>:3:24: 7:20
}
bb11: { // cleanup
goto -> bb20; // bb11[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb12: {
drop((_1.2: impl std::future::Future)) -> [return: bb13, unwind: bb11]; // bb12[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb13: {
goto -> bb21; // bb13[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb14: {
generator_drop; // bb14[0]: scope 0 at src/main.rs:10:21: 14:2
}
bb15: {
nop; // bb15[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
_17 = (); // bb15[1]: scope 0 at src/main.rs:10:21: 14:2
nop; // bb15[2]: scope 0 at src/main.rs:14:1: 14:2
goto -> bb23; // bb15[3]: scope 0 at src/main.rs:14:1: 14:2
}
bb16: {
_0 = std::ops::GeneratorState<(), ()>::Complete(move _17,); // bb16[0]: scope 0 at src/main.rs:14:2: 14:2
(_1.0: u32) = const 1u32; // bb16[1]: scope 0 at src/main.rs:14:2: 14:2
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 1 })
// mir::Constant
// + span: src/main.rs:14:2: 14:2
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 1 }) })
return; // bb16[2]: scope 0 at src/main.rs:14:2: 14:2
}
bb17: {
return; // bb17[0]: scope 0 at src/main.rs:10:21: 14:2
}
bb18: {
goto -> bb25; // bb18[0]: scope 0 at src/main.rs:10:21: 14:2
}
bb19: { // cleanup
goto -> bb1; // bb19[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb20: { // cleanup
goto -> bb1; // bb20[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb21: {
goto -> bb14; // bb21[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb22: { // cleanup
goto -> bb1; // bb22[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb23: {
goto -> bb16; // bb23[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb24: { // cleanup
goto -> bb1; // bb24[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb25: { // cleanup
goto -> bb17; // bb25[0]: scope 0 at src/main.rs:10:21: 14:2
}
}
// MIR for `composed::{{closure}}`
// source = MirSource { instance: Item(DefId(0/1:14 ~ foo[16c4]::composed[0]::{{closure}}[0])), promoted: None }
// pass_name = generator_pre-elab
// disambiguator = 0
// generator_layout = GeneratorLayout { fields: [LocalDecl { mutability: Not, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutImmutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:11:17: 11:27)), pat_span: src/main.rs:11:9: 11:14 }))), internal: false, is_block_tail: None, ty: impl std::future::Future, user_ty: UserTypeProjections { contents: [] }, name: Some(inner), source_info: SourceInfo { span: src/main.rs:11:9: 11:14, scope: scope[2] }, visibility_scope: scope[1] }, LocalDecl { mutability: Mut, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutMutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:13:12: 13:17)), pat_span: <::std::macros::await macros>:3:5: 3:15 }))), internal: false, is_block_tail: None, ty: impl std::future::Future, user_ty: UserTypeProjections { contents: [] }, name: Some(pinned), source_info: SourceInfo { span: <::std::macros::await macros>:3:5: 3:15, scope: scope[6] }, visibility_scope: scope[5] }] }
| User Type Annotations
| 0: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }, CanonicalVarInfo { kind: Ty(General(U0)) }], value: TypeOf(DefId(2/0:1875 ~ core[ae7c]::pin[0]::{{impl}}[3]::new_unchecked[0]), UserSubsts { substs: [^0], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2/0:1874 ~ core[ae7c]::pin[0]::{{impl}}[3]), self_ty: std::pin::Pin<^1> }) }) } at <::std::macros::await macros>:6:10: 6:48
|
fn composed::{{closure}}(_1: [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}]) -> std::ops::GeneratorState<(), ()> {
let mut _0: std::ops::GeneratorState<(), ()>; // return place
scope 1 {
scope 3 {
}
scope 4 {
let _4: &impl std::future::Future; // "_foo" in scope 4 at src/main.rs:12:11: 12:15
}
scope 5 {
let _13: bool; // "x" in scope 5 at <::std::macros::await macros>:4:43: 4:44
scope 7 {
}
scope 8 {
}
}
scope 6 {
}
}
scope 2 {
}
let mut _2: ();
let mut _3: ();
let mut _5: bool;
let mut _6: ();
let mut _7: ();
let mut _8: ();
let mut _9: std::task::Poll<bool>;
let mut _10: std::pin::Pin<&mut impl std::future::Future>;
let mut _11: &mut impl std::future::Future;
let mut _12: &mut impl std::future::Future;
let mut _14: isize;
let mut _15: !;
let mut _16: ();
let mut _17: ();
bb0: {
nop; // bb0[0]: scope 0 at src/main.rs:11:9: 11:14
(_1.1: impl std::future::Future) = const i_am_1kb() -> [return: bb2, unwind: bb3]; // bb0[1]: scope 0 at src/main.rs:11:17: 11:27
// ty::Const
// + ty: fn() -> impl std::future::Future {i_am_1kb}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: src/main.rs:11:17: 11:25
// + ty: fn() -> impl std::future::Future {i_am_1kb}
// + literal: Evaluated(Const { ty: fn() -> impl std::future::Future {i_am_1kb}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb1: { // cleanup
resume; // bb1[0]: scope 0 at src/main.rs:10:21: 14:2
}
bb2: {
StorageLive(_4); // bb2[0]: scope 1 at src/main.rs:12:11: 12:15
_4 = &(_1.1: impl std::future::Future); // bb2[1]: scope 1 at src/main.rs:12:18: 12:24
_3 = (); // bb2[2]: scope 1 at src/main.rs:12:5: 12:27
StorageDead(_4); // bb2[3]: scope 1 at src/main.rs:12:26: 12:27
nop; // bb2[4]: scope 1 at <::std::macros::await macros>:3:5: 3:15
(_1.2: impl std::future::Future) = move (_1.1: impl std::future::Future); // bb2[5]: scope 1 at src/main.rs:13:12: 13:17
goto -> bb4; // bb2[6]: scope 5 at <::std::macros::await macros>:3:24: 7:20
}
bb3: { // cleanup
drop(_1) -> bb1; // bb3[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb4: {
StorageLive(_9); // bb4[0]: scope 5 at <::std::macros::await macros>:4:49: 6:69
StorageLive(_10); // bb4[1]: scope 5 at <::std::macros::await macros>:6:1: 6:67
StorageLive(_11); // bb4[2]: scope 7 at <::std::macros::await macros>:6:51: 6:63
StorageLive(_12); // bb4[3]: scope 7 at <::std::macros::await macros>:6:51: 6:63
_12 = &mut (_1.2: impl std::future::Future); // bb4[4]: scope 7 at <::std::macros::await macros>:6:51: 6:63
_11 = &mut (*_12); // bb4[5]: scope 7 at <::std::macros::await macros>:6:51: 6:63
_10 = const <std::pin::Pin<P>>::new_unchecked(move _11) -> [return: bb6, unwind: bb5]; // bb4[6]: scope 7 at <::std::macros::await macros>:6:10: 6:65
// ty::Const
// + ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::await macros>:6:10: 6:48
// + ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}
// + user_ty: UserType(0)
// + literal: Evaluated(Const { ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb5: { // cleanup
drop((_1.2: impl std::future::Future)) -> bb3; // bb5[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb6: {
StorageDead(_11); // bb6[0]: scope 7 at <::std::macros::await macros>:6:64: 6:65
_9 = const std::future::poll_with_tls_waker(move _10) -> [return: bb7, unwind: bb5]; // bb6[1]: scope 5 at <::std::macros::await macros>:4:49: 6:69
// ty::Const
// + ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::await macros>:4:49: 5:20
// + ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}
// + literal: Evaluated(Const { ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb7: {
StorageDead(_10); // bb7[0]: scope 5 at <::std::macros::await macros>:6:68: 6:69
_14 = discriminant(_9); // bb7[1]: scope 5 at <::std::macros::await macros>:4:8: 4:46
switchInt(move _14) -> [0isize: bb9, otherwise: bb8]; // bb7[2]: scope 5 at <::std::macros::await macros>:4:8: 4:46
}
bb8: {
_8 = (); // bb8[0]: scope 5 at <::std::macros::await macros>:4:1: 7:12
StorageDead(_13); // bb8[1]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_9); // bb8[2]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_12); // bb8[3]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageLive(_16); // bb8[4]: scope 5 at <::std::macros::await macros>:7:13: 7:18
_16 = (); // bb8[5]: scope 5 at <::std::macros::await macros>:7:13: 7:18
_0 = std::ops::GeneratorState<(), ()>::Yielded(move _16,); // bb8[6]: scope 5 at <::std::macros::await macros>:7:13: 7:18
(_1.0: u32) = const 3u32; // bb8[7]: scope 5 at <::std::macros::await macros>:7:13: 7:18
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 3 })
// mir::Constant
// + span: <::std::macros::await macros>:7:13: 7:18
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 3 }) })
return; // bb8[8]: scope 5 at <::std::macros::await macros>:7:13: 7:18
}
bb9: {
StorageLive(_13); // bb9[0]: scope 5 at <::std::macros::await macros>:4:43: 4:44
_13 = ((_9 as Ready).0: bool); // bb9[1]: scope 5 at <::std::macros::await macros>:4:43: 4:44
_5 = _13; // bb9[2]: scope 8 at <::std::macros::await macros>:7:7: 7:8
StorageDead(_13); // bb9[3]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_9); // bb9[4]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_12); // bb9[5]: scope 5 at <::std::macros::await macros>:7:11: 7:12
drop((_1.2: impl std::future::Future)) -> [return: bb15, unwind: bb3]; // bb9[6]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb10: {
_7 = (); // bb10[0]: scope 5 at <::std::macros::await macros>:7:13: 7:18
StorageDead(_16); // bb10[1]: scope 5 at <::std::macros::await macros>:7:17: 7:18
goto -> bb4; // bb10[2]: scope 5 at <::std::macros::await macros>:3:24: 7:20
}
bb11: { // cleanup
drop(_1) -> bb1; // bb11[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb12: {
drop((_1.2: impl std::future::Future)) -> [return: bb13, unwind: bb11]; // bb12[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb13: {
drop(_1) -> [return: bb14, unwind: bb1]; // bb13[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb14: {
generator_drop; // bb14[0]: scope 0 at src/main.rs:10:21: 14:2
}
bb15: {
nop; // bb15[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
_17 = (); // bb15[1]: scope 0 at src/main.rs:10:21: 14:2
nop; // bb15[2]: scope 0 at src/main.rs:14:1: 14:2
drop(_1) -> [return: bb16, unwind: bb1]; // bb15[3]: scope 0 at src/main.rs:14:1: 14:2
}
bb16: {
_0 = std::ops::GeneratorState<(), ()>::Complete(move _17,); // bb16[0]: scope 0 at src/main.rs:14:2: 14:2
(_1.0: u32) = const 1u32; // bb16[1]: scope 0 at src/main.rs:14:2: 14:2
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 1 })
// mir::Constant
// + span: src/main.rs:14:2: 14:2
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 1 }) })
return; // bb16[2]: scope 0 at src/main.rs:14:2: 14:2
}
bb17: {
return; // bb17[0]: scope 0 at src/main.rs:10:21: 14:2
}
bb18: {
drop(_1) -> bb17; // bb18[0]: scope 0 at src/main.rs:10:21: 14:2
}
}
// MIR for `composed::{{closure}}`
// source = MirSource { instance: Item(DefId(0/1:14 ~ foo[16c4]::composed[0]::{{closure}}[0])), promoted: None }
// pass_name = generator_resume
// disambiguator = 0
// generator_layout = GeneratorLayout { fields: [LocalDecl { mutability: Not, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutImmutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:11:17: 11:27)), pat_span: src/main.rs:11:9: 11:14 }))), internal: false, is_block_tail: None, ty: impl std::future::Future, user_ty: UserTypeProjections { contents: [] }, name: Some(inner), source_info: SourceInfo { span: src/main.rs:11:9: 11:14, scope: scope[2] }, visibility_scope: scope[1] }, LocalDecl { mutability: Mut, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutMutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:13:12: 13:17)), pat_span: <::std::macros::await macros>:3:5: 3:15 }))), internal: false, is_block_tail: None, ty: impl std::future::Future, user_ty: UserTypeProjections { contents: [] }, name: Some(pinned), source_info: SourceInfo { span: <::std::macros::await macros>:3:5: 3:15, scope: scope[6] }, visibility_scope: scope[5] }] }
| User Type Annotations
| 0: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }, CanonicalVarInfo { kind: Ty(General(U0)) }], value: TypeOf(DefId(2/0:1875 ~ core[ae7c]::pin[0]::{{impl}}[3]::new_unchecked[0]), UserSubsts { substs: [^0], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2/0:1874 ~ core[ae7c]::pin[0]::{{impl}}[3]), self_ty: std::pin::Pin<^1> }) }) } at <::std::macros::await macros>:6:10: 6:48
|
fn composed::{{closure}}(_1: std::pin::Pin<&mut [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}]>) -> std::ops::GeneratorState<(), ()> {
let mut _0: std::ops::GeneratorState<(), ()>; // return place
scope 1 {
scope 3 {
}
scope 4 {
let _4: &impl std::future::Future; // "_foo" in scope 4 at src/main.rs:12:11: 12:15
}
scope 5 {
let _13: bool; // "x" in scope 5 at <::std::macros::await macros>:4:43: 4:44
scope 7 {
}
scope 8 {
}
}
scope 6 {
}
}
scope 2 {
}
let mut _2: ();
let mut _3: ();
let mut _5: bool;
let mut _6: ();
let mut _7: ();
let mut _8: ();
let mut _9: std::task::Poll<bool>;
let mut _10: std::pin::Pin<&mut impl std::future::Future>;
let mut _11: &mut impl std::future::Future;
let mut _12: &mut impl std::future::Future;
let mut _14: isize;
let mut _15: !;
let mut _16: ();
let mut _17: ();
bb0: {
switchInt(((*(_1.0: &mut [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}])).0: u32)) -> [0u32: bb1, 1u32: bb17, 2u32: bb18, 3u32: bb16, otherwise: bb19]; // bb0[0]: scope 0 at src/main.rs:10:21: 14:2
}
bb1: {
nop; // bb1[0]: scope 0 at src/main.rs:11:9: 11:14
((*(_1.0: &mut [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}])).1: impl std::future::Future) = const i_am_1kb() -> [return: bb3, unwind: bb4]; // bb1[1]: scope 0 at src/main.rs:11:17: 11:27
// ty::Const
// + ty: fn() -> impl std::future::Future {i_am_1kb}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: src/main.rs:11:17: 11:25
// + ty: fn() -> impl std::future::Future {i_am_1kb}
// + literal: Evaluated(Const { ty: fn() -> impl std::future::Future {i_am_1kb}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb2: { // cleanup
((*(_1.0: &mut [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}])).0: u32) = const 1u32; // bb2[0]: scope 0 at src/main.rs:10:21: 14:2
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 1 })
// mir::Constant
// + span: src/main.rs:10:21: 14:2
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 1 }) })
resume; // bb2[1]: scope 0 at src/main.rs:10:21: 14:2
}
bb3: {
StorageLive(_4); // bb3[0]: scope 1 at src/main.rs:12:11: 12:15
_4 = &((*(_1.0: &mut [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}])).1: impl std::future::Future); // bb3[1]: scope 1 at src/main.rs:12:18: 12:24
_3 = (); // bb3[2]: scope 1 at src/main.rs:12:5: 12:27
StorageDead(_4); // bb3[3]: scope 1 at src/main.rs:12:26: 12:27
nop; // bb3[4]: scope 1 at <::std::macros::await macros>:3:5: 3:15
((*(_1.0: &mut [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}])).2: impl std::future::Future) = move ((*(_1.0: &mut [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}])).1: impl std::future::Future); // bb3[5]: scope 1 at src/main.rs:13:12: 13:17
goto -> bb5; // bb3[6]: scope 5 at <::std::macros::await macros>:3:24: 7:20
}
bb4: { // cleanup
goto -> bb14; // bb4[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb5: {
StorageLive(_9); // bb5[0]: scope 5 at <::std::macros::await macros>:4:49: 6:69
StorageLive(_10); // bb5[1]: scope 5 at <::std::macros::await macros>:6:1: 6:67
StorageLive(_11); // bb5[2]: scope 7 at <::std::macros::await macros>:6:51: 6:63
StorageLive(_12); // bb5[3]: scope 7 at <::std::macros::await macros>:6:51: 6:63
_12 = &mut ((*(_1.0: &mut [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}])).2: impl std::future::Future); // bb5[4]: scope 7 at <::std::macros::await macros>:6:51: 6:63
_11 = &mut (*_12); // bb5[5]: scope 7 at <::std::macros::await macros>:6:51: 6:63
_10 = const <std::pin::Pin<P>>::new_unchecked(move _11) -> [return: bb7, unwind: bb6]; // bb5[6]: scope 7 at <::std::macros::await macros>:6:10: 6:65
// ty::Const
// + ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::await macros>:6:10: 6:48
// + ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}
// + user_ty: UserType(0)
// + literal: Evaluated(Const { ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb6: { // cleanup
drop(((*(_1.0: &mut [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}])).2: impl std::future::Future)) -> bb4; // bb6[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb7: {
StorageDead(_11); // bb7[0]: scope 7 at <::std::macros::await macros>:6:64: 6:65
_9 = const std::future::poll_with_tls_waker(move _10) -> [return: bb8, unwind: bb6]; // bb7[1]: scope 5 at <::std::macros::await macros>:4:49: 6:69
// ty::Const
// + ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::await macros>:4:49: 5:20
// + ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}
// + literal: Evaluated(Const { ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb8: {
StorageDead(_10); // bb8[0]: scope 5 at <::std::macros::await macros>:6:68: 6:69
_14 = discriminant(_9); // bb8[1]: scope 5 at <::std::macros::await macros>:4:8: 4:46
switchInt(move _14) -> [0isize: bb10, otherwise: bb9]; // bb8[2]: scope 5 at <::std::macros::await macros>:4:8: 4:46
}
bb9: {
_8 = (); // bb9[0]: scope 5 at <::std::macros::await macros>:4:1: 7:12
StorageDead(_13); // bb9[1]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_9); // bb9[2]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_12); // bb9[3]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageLive(_16); // bb9[4]: scope 5 at <::std::macros::await macros>:7:13: 7:18
_16 = (); // bb9[5]: scope 5 at <::std::macros::await macros>:7:13: 7:18
_0 = std::ops::GeneratorState<(), ()>::Yielded(move _16,); // bb9[6]: scope 5 at <::std::macros::await macros>:7:13: 7:18
((*(_1.0: &mut [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}])).0: u32) = const 3u32; // bb9[7]: scope 5 at <::std::macros::await macros>:7:13: 7:18
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 3 })
// mir::Constant
// + span: <::std::macros::await macros>:7:13: 7:18
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 3 }) })
return; // bb9[8]: scope 5 at <::std::macros::await macros>:7:13: 7:18
}
bb10: {
StorageLive(_13); // bb10[0]: scope 5 at <::std::macros::await macros>:4:43: 4:44
_13 = ((_9 as Ready).0: bool); // bb10[1]: scope 5 at <::std::macros::await macros>:4:43: 4:44
_5 = _13; // bb10[2]: scope 8 at <::std::macros::await macros>:7:7: 7:8
StorageDead(_13); // bb10[3]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_9); // bb10[4]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_12); // bb10[5]: scope 5 at <::std::macros::await macros>:7:11: 7:12
drop(((*(_1.0: &mut [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}])).2: impl std::future::Future)) -> [return: bb12, unwind: bb4]; // bb10[6]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb11: {
_7 = (); // bb11[0]: scope 5 at <::std::macros::await macros>:7:13: 7:18
StorageDead(_16); // bb11[1]: scope 5 at <::std::macros::await macros>:7:17: 7:18
goto -> bb5; // bb11[2]: scope 5 at <::std::macros::await macros>:3:24: 7:20
}
bb12: {
nop; // bb12[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
_17 = (); // bb12[1]: scope 0 at src/main.rs:10:21: 14:2
nop; // bb12[2]: scope 0 at src/main.rs:14:1: 14:2
goto -> bb15; // bb12[3]: scope 0 at src/main.rs:14:1: 14:2
}
bb13: {
_0 = std::ops::GeneratorState<(), ()>::Complete(move _17,); // bb13[0]: scope 0 at src/main.rs:14:2: 14:2
((*(_1.0: &mut [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}])).0: u32) = const 1u32; // bb13[1]: scope 0 at src/main.rs:14:2: 14:2
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 1 })
// mir::Constant
// + span: src/main.rs:14:2: 14:2
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 1 }) })
return; // bb13[2]: scope 0 at src/main.rs:14:2: 14:2
}
bb14: { // cleanup
goto -> bb2; // bb14[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb15: {
goto -> bb13; // bb15[0]: scope 0 at src/main.rs:14:1: 14:2
}
bb16: {
StorageLive(_16); // bb16[0]: scope 0 at src/main.rs:10:21: 14:2
goto -> bb11; // bb16[1]: scope 0 at src/main.rs:10:21: 14:2
}
bb17: {
assert(const false, "generator resumed after completion") -> bb17; // bb17[0]: scope 0 at src/main.rs:10:21: 14:2
// ty::Const
// + ty: bool
// + val: Scalar(Bits { size: 1, bits: 0 })
// mir::Constant
// + span: src/main.rs:10:21: 14:2
// + ty: bool
// + literal: Evaluated(Const { ty: bool, val: Scalar(Bits { size: 1, bits: 0 }) })
}
bb18: {
assert(const false, "generator resumed after panicking") -> bb18; // bb18[0]: scope 0 at src/main.rs:10:21: 14:2
// ty::Const
// + ty: bool
// + val: Scalar(Bits { size: 1, bits: 0 })
// mir::Constant
// + span: src/main.rs:10:21: 14:2
// + ty: bool
// + literal: Evaluated(Const { ty: bool, val: Scalar(Bits { size: 1, bits: 0 }) })
}
bb19: {
unreachable; // bb19[0]: scope 0 at src/main.rs:10:21: 14:2
}
}
// MIR for `i_am_1kb::{{closure}}::{{closure}}`
// source = MirSource { instance: Item(DefId(0/1:15 ~ foo[16c4]::i_am_1kb[0]::{{closure}}[0]::{{closure}}[0])), promoted: None }
// pass_name = generator_drop
// disambiguator = 0
// generator_layout = GeneratorLayout { fields: [] }
fn i_am_1kb::{{closure}}::{{closure}}(_1: *mut [static generator@src/main.rs:5:17: 5:19 {}]) -> () {
let mut _0: (); // return place
let mut _2: ();
bb0: {
switchInt(((*_1).0: u32)) -> [0u32: bb2, otherwise: bb4]; // bb0[0]: scope 0 at src/main.rs:5:17: 5:19
}
bb1: {
return; // bb1[0]: scope 0 at src/main.rs:5:17: 5:19
}
bb2: {
goto -> bb3; // bb2[0]: scope 0 at src/main.rs:5:17: 5:19
}
bb3: { // cleanup
goto -> bb1; // bb3[0]: scope 0 at src/main.rs:5:17: 5:19
}
bb4: {
return; // bb4[0]: scope 0 at src/main.rs:5:17: 5:19
}
}
// MIR for `i_am_1kb::{{closure}}::{{closure}}`
// source = MirSource { instance: Item(DefId(0/1:15 ~ foo[16c4]::i_am_1kb[0]::{{closure}}[0]::{{closure}}[0])), promoted: None }
// pass_name = generator_post-transform
// disambiguator = 0
// generator_layout = GeneratorLayout { fields: [] }
fn i_am_1kb::{{closure}}::{{closure}}(_1: [static generator@src/main.rs:5:17: 5:19 {}]) -> std::ops::GeneratorState<(), ()> {
let mut _0: std::ops::GeneratorState<(), ()>; // return place
let mut _2: ();
bb0: {
_2 = (); // bb0[0]: scope 0 at src/main.rs:5:17: 5:19
goto -> bb5; // bb0[1]: scope 0 at src/main.rs:5:18: 5:19
}
bb1: {
_0 = std::ops::GeneratorState<(), ()>::Complete(move _2,); // bb1[0]: scope 0 at src/main.rs:5:19: 5:19
(_1.0: u32) = const 1u32; // bb1[1]: scope 0 at src/main.rs:5:19: 5:19
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 1 })
// mir::Constant
// + span: src/main.rs:5:19: 5:19
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 1 }) })
return; // bb1[2]: scope 0 at src/main.rs:5:19: 5:19
}
bb2: { // cleanup
resume; // bb2[0]: scope 0 at src/main.rs:5:17: 5:19
}
bb3: {
return; // bb3[0]: scope 0 at src/main.rs:5:17: 5:19
}
bb4: {
goto -> bb7; // bb4[0]: scope 0 at src/main.rs:5:17: 5:19
}
bb5: {
goto -> bb1; // bb5[0]: scope 0 at src/main.rs:5:18: 5:19
}
bb6: { // cleanup
goto -> bb2; // bb6[0]: scope 0 at src/main.rs:5:18: 5:19
}
bb7: { // cleanup
goto -> bb3; // bb7[0]: scope 0 at src/main.rs:5:17: 5:19
}
}
// MIR for `i_am_1kb::{{closure}}::{{closure}}`
// source = MirSource { instance: Item(DefId(0/1:15 ~ foo[16c4]::i_am_1kb[0]::{{closure}}[0]::{{closure}}[0])), promoted: None }
// pass_name = generator_pre-elab
// disambiguator = 0
// generator_layout = GeneratorLayout { fields: [] }
fn i_am_1kb::{{closure}}::{{closure}}(_1: [static generator@src/main.rs:5:17: 5:19 {}]) -> std::ops::GeneratorState<(), ()> {
let mut _0: std::ops::GeneratorState<(), ()>; // return place
let mut _2: ();
bb0: {
_2 = (); // bb0[0]: scope 0 at src/main.rs:5:17: 5:19
drop(_1) -> [return: bb1, unwind: bb2]; // bb0[1]: scope 0 at src/main.rs:5:18: 5:19
}
bb1: {
_0 = std::ops::GeneratorState<(), ()>::Complete(move _2,); // bb1[0]: scope 0 at src/main.rs:5:19: 5:19
(_1.0: u32) = const 1u32; // bb1[1]: scope 0 at src/main.rs:5:19: 5:19
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 1 })
// mir::Constant
// + span: src/main.rs:5:19: 5:19
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 1 }) })
return; // bb1[2]: scope 0 at src/main.rs:5:19: 5:19
}
bb2: { // cleanup
resume; // bb2[0]: scope 0 at src/main.rs:5:17: 5:19
}
bb3: {
return; // bb3[0]: scope 0 at src/main.rs:5:17: 5:19
}
bb4: {
drop(_1) -> bb3; // bb4[0]: scope 0 at src/main.rs:5:17: 5:19
}
}
// MIR for `i_am_1kb::{{closure}}::{{closure}}`
// source = MirSource { instance: Item(DefId(0/1:15 ~ foo[16c4]::i_am_1kb[0]::{{closure}}[0]::{{closure}}[0])), promoted: None }
// pass_name = generator_resume
// disambiguator = 0
// generator_layout = GeneratorLayout { fields: [] }
fn i_am_1kb::{{closure}}::{{closure}}(_1: std::pin::Pin<&mut [static generator@src/main.rs:5:17: 5:19 {}]>) -> std::ops::GeneratorState<(), ()> {
let mut _0: std::ops::GeneratorState<(), ()>; // return place
let mut _2: ();
bb0: {
switchInt(((*(_1.0: &mut [static generator@src/main.rs:5:17: 5:19 {}])).0: u32)) -> [0u32: bb1, 1u32: bb4, 2u32: bb5, otherwise: bb6]; // bb0[0]: scope 0 at src/main.rs:5:17: 5:19
}
bb1: {
_2 = (); // bb1[0]: scope 0 at src/main.rs:5:17: 5:19
goto -> bb3; // bb1[1]: scope 0 at src/main.rs:5:18: 5:19
}
bb2: {
_0 = std::ops::GeneratorState<(), ()>::Complete(move _2,); // bb2[0]: scope 0 at src/main.rs:5:19: 5:19
((*(_1.0: &mut [static generator@src/main.rs:5:17: 5:19 {}])).0: u32) = const 1u32; // bb2[1]: scope 0 at src/main.rs:5:19: 5:19
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 1 })
// mir::Constant
// + span: src/main.rs:5:19: 5:19
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 1 }) })
return; // bb2[2]: scope 0 at src/main.rs:5:19: 5:19
}
bb3: {
goto -> bb2; // bb3[0]: scope 0 at src/main.rs:5:18: 5:19
}
bb4: {
assert(const false, "generator resumed after completion") -> bb4; // bb4[0]: scope 0 at src/main.rs:5:17: 5:19
// ty::Const
// + ty: bool
// + val: Scalar(Bits { size: 1, bits: 0 })
// mir::Constant
// + span: src/main.rs:5:17: 5:19
// + ty: bool
// + literal: Evaluated(Const { ty: bool, val: Scalar(Bits { size: 1, bits: 0 }) })
}
bb5: {
assert(const false, "generator resumed after panicking") -> bb5; // bb5[0]: scope 0 at src/main.rs:5:17: 5:19
// ty::Const
// + ty: bool
// + val: Scalar(Bits { size: 1, bits: 0 })
// mir::Constant
// + span: src/main.rs:5:17: 5:19
// + ty: bool
// + literal: Evaluated(Const { ty: bool, val: Scalar(Bits { size: 1, bits: 0 }) })
}
bb6: {
unreachable; // bb6[0]: scope 0 at src/main.rs:5:17: 5:19
}
}
// MIR for `i_am_1kb::{{closure}}`
// source = MirSource { instance: Item(DefId(0/1:10 ~ foo[16c4]::i_am_1kb[0]::{{closure}}[0])), promoted: None }
// pass_name = generator_drop
// disambiguator = 0
// generator_layout = GeneratorLayout { fields: [LocalDecl { mutability: Not, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutImmutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:4:27: 4:38)), pat_span: src/main.rs:4:9: 4:10 }))), internal: false, is_block_tail: None, ty: [u8; 1024], user_ty: UserTypeProjections { contents: [(UserTypeProjection { base: UserType(0), projs: [] }, src/main.rs:4:12: 4:24)] }, name: Some(x), source_info: SourceInfo { span: src/main.rs:4:9: 4:10, scope: scope[2] }, visibility_scope: scope[1] }, LocalDecl { mutability: Mut, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutMutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:5:12: 5:19)), pat_span: <::std::macros::await macros>:3:5: 3:15 }))), internal: false, is_block_tail: None, ty: impl std::future::Future, user_ty: UserTypeProjections { contents: [] }, name: Some(pinned), source_info: SourceInfo { span: <::std::macros::await macros>:3:5: 3:15, scope: scope[4] }, visibility_scope: scope[3] }] }
| User Type Annotations
| 0: Canonical { max_universe: U0, variables: [], value: Ty([u8; 1024]) } at src/main.rs:4:12: 4:24
| 1: Canonical { max_universe: U0, variables: [], value: Ty([u8; 1024]) } at src/main.rs:4:12: 4:24
| 2: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }, CanonicalVarInfo { kind: Ty(General(U0)) }], value: TypeOf(DefId(2/0:1875 ~ core[ae7c]::pin[0]::{{impl}}[3]::new_unchecked[0]), UserSubsts { substs: [^0], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2/0:1874 ~ core[ae7c]::pin[0]::{{impl}}[3]), self_ty: std::pin::Pin<^1> }) }) } at <::std::macros::await macros>:6:10: 6:48
| 3: Canonical { max_universe: U0, variables: [], value: Ty(u8) } at src/main.rs:6:15: 6:17
| 4: Canonical { max_universe: U0, variables: [], value: Ty(u8) } at src/main.rs:6:15: 6:17
|
fn i_am_1kb::{{closure}}(_1: *mut [static generator@src/main.rs:3:29: 8:2 {[u8; 1024], impl std::future::Future, ()}]) -> () {
let mut _0: (); // return place
scope 1 {
scope 3 {
let _12: (); // "x" in scope 3 at <::std::macros::await macros>:4:43: 4:44
scope 5 {
}
scope 6 {
}
}
scope 4 {
}
scope 7 {
}
scope 8 {
let _16: u8 as UserTypeProjection { base: UserType(3), projs: [] }; // "_sum" in scope 8 at src/main.rs:6:9: 6:13
}
}
scope 2 {
}
let mut _2: ();
let mut _3: ();
let mut _4: ();
let mut _5: [static generator@src/main.rs:5:17: 5:19 {}];
let mut _6: ();
let mut _7: ();
let mut _8: std::task::Poll<()>;
let mut _9: std::pin::Pin<&mut impl std::future::Future>;
let mut _10: &mut impl std::future::Future;
let mut _11: &mut impl std::future::Future;
let mut _13: isize;
let mut _14: !;
let mut _15: ();
let mut _17: std::slice::Iter<u8>;
let mut _18: &[u8];
let mut _19: &[u8; 1024];
let mut _20: bool;
bb0: {
switchInt(((*_1).0: u32)) -> [0u32: bb7, 3u32: bb11, otherwise: bb12]; // bb0[0]: scope 0 at src/main.rs:3:29: 8:2
}
bb1: { // cleanup
resume; // bb1[0]: scope 0 at src/main.rs:3:29: 8:2
}
bb2: { // cleanup
goto -> bb8; // bb2[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb3: {
drop(((*_1).2: impl std::future::Future)) -> [return: bb4, unwind: bb2]; // bb3[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb4: {
goto -> bb9; // bb4[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb5: {
return; // bb5[0]: scope 0 at src/main.rs:3:29: 8:2
}
bb6: {
return; // bb6[0]: scope 0 at src/main.rs:3:29: 8:2
}
bb7: {
goto -> bb10; // bb7[0]: scope 0 at src/main.rs:3:29: 8:2
}
bb8: { // cleanup
goto -> bb1; // bb8[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb9: {
goto -> bb5; // bb9[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb10: { // cleanup
goto -> bb6; // bb10[0]: scope 0 at src/main.rs:3:29: 8:2
}
bb11: {
StorageLive(_15); // bb11[0]: scope 0 at src/main.rs:3:29: 8:2
goto -> bb3; // bb11[1]: scope 0 at src/main.rs:3:29: 8:2
}
bb12: {
return; // bb12[0]: scope 0 at src/main.rs:3:29: 8:2
}
}
// MIR for `i_am_1kb::{{closure}}`
// source = MirSource { instance: Item(DefId(0/1:10 ~ foo[16c4]::i_am_1kb[0]::{{closure}}[0])), promoted: None }
// pass_name = generator_post-transform
// disambiguator = 0
// generator_layout = GeneratorLayout { fields: [LocalDecl { mutability: Not, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutImmutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:4:27: 4:38)), pat_span: src/main.rs:4:9: 4:10 }))), internal: false, is_block_tail: None, ty: [u8; 1024], user_ty: UserTypeProjections { contents: [(UserTypeProjection { base: UserType(0), projs: [] }, src/main.rs:4:12: 4:24)] }, name: Some(x), source_info: SourceInfo { span: src/main.rs:4:9: 4:10, scope: scope[2] }, visibility_scope: scope[1] }, LocalDecl { mutability: Mut, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutMutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:5:12: 5:19)), pat_span: <::std::macros::await macros>:3:5: 3:15 }))), internal: false, is_block_tail: None, ty: impl std::future::Future, user_ty: UserTypeProjections { contents: [] }, name: Some(pinned), source_info: SourceInfo { span: <::std::macros::await macros>:3:5: 3:15, scope: scope[4] }, visibility_scope: scope[3] }] }
| User Type Annotations
| 0: Canonical { max_universe: U0, variables: [], value: Ty([u8; 1024]) } at src/main.rs:4:12: 4:24
| 1: Canonical { max_universe: U0, variables: [], value: Ty([u8; 1024]) } at src/main.rs:4:12: 4:24
| 2: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }, CanonicalVarInfo { kind: Ty(General(U0)) }], value: TypeOf(DefId(2/0:1875 ~ core[ae7c]::pin[0]::{{impl}}[3]::new_unchecked[0]), UserSubsts { substs: [^0], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2/0:1874 ~ core[ae7c]::pin[0]::{{impl}}[3]), self_ty: std::pin::Pin<^1> }) }) } at <::std::macros::await macros>:6:10: 6:48
| 3: Canonical { max_universe: U0, variables: [], value: Ty(u8) } at src/main.rs:6:15: 6:17
| 4: Canonical { max_universe: U0, variables: [], value: Ty(u8) } at src/main.rs:6:15: 6:17
|
fn i_am_1kb::{{closure}}(_1: [static generator@src/main.rs:3:29: 8:2 {[u8; 1024], impl std::future::Future, ()}]) -> std::ops::GeneratorState<(), bool> {
let mut _0: std::ops::GeneratorState<(), bool>; // return place
scope 1 {
scope 3 {
let _12: (); // "x" in scope 3 at <::std::macros::await macros>:4:43: 4:44
scope 5 {
}
scope 6 {
}
}
scope 4 {
}
scope 7 {
}
scope 8 {
let _16: u8 as UserTypeProjection { base: UserType(3), projs: [] }; // "_sum" in scope 8 at src/main.rs:6:9: 6:13
}
}
scope 2 {
}
let mut _2: ();
let mut _3: ();
let mut _4: ();
let mut _5: [static generator@src/main.rs:5:17: 5:19 {}];
let mut _6: ();
let mut _7: ();
let mut _8: std::task::Poll<()>;
let mut _9: std::pin::Pin<&mut impl std::future::Future>;
let mut _10: &mut impl std::future::Future;
let mut _11: &mut impl std::future::Future;
let mut _13: isize;
let mut _14: !;
let mut _15: ();
let mut _17: std::slice::Iter<u8>;
let mut _18: &[u8];
let mut _19: &[u8; 1024];
let mut _20: bool;
bb0: {
nop; // bb0[0]: scope 0 at src/main.rs:4:9: 4:10
(_1.1: [u8; 1024]) = [const 0u8; 1024]; // bb0[1]: scope 0 at src/main.rs:4:27: 4:38
// ty::Const
// + ty: u8
// + val: Scalar(Bits { size: 1, bits: 0 })
// mir::Constant
// + span: src/main.rs:4:28: 4:29
// + ty: u8
// + literal: Evaluated(Const { ty: u8, val: Scalar(Bits { size: 1, bits: 0 }) })
nop; // bb0[2]: scope 1 at <::std::macros::await macros>:3:5: 3:15
StorageLive(_5); // bb0[3]: scope 1 at src/main.rs:5:17: 5:19
_5 = [generator@src/main.rs:5:17: 5:19] { $state: const 0u32 }; // bb0[4]: scope 1 at src/main.rs:5:17: 5:19
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 0 })
// mir::Constant
// + span: src/main.rs:5:17: 5:19
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 0 }) })
// generator
// + def_id: DefId(0/1:15 ~ foo[16c4]::i_am_1kb[0]::{{closure}}[0]::{{closure}}[0])
// + substs: GeneratorSubsts {
// substs: [
// (),
// (),
// {}
// ]
// }
// + movability: Static
(_1.2: impl std::future::Future) = const std::future::from_generator(move _5) -> [return: bb3, unwind: bb2]; // bb0[5]: scope 1 at src/main.rs:5:12: 5:19
// ty::Const
// + ty: fn([static generator@src/main.rs:5:17: 5:19 {}]) -> impl std::future::Future {std::future::from_generator::<[static generator@src/main.rs:5:17: 5:19 {}]>}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: src/main.rs:5:17: 5:19
// + ty: fn([static generator@src/main.rs:5:17: 5:19 {}]) -> impl std::future::Future {std::future::from_generator::<[static generator@src/main.rs:5:17: 5:19 {}]>}
// + literal: Evaluated(Const { ty: fn([static generator@src/main.rs:5:17: 5:19 {}]) -> impl std::future::Future {std::future::from_generator::<[static generator@src/main.rs:5:17: 5:19 {}]>}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb1: { // cleanup
resume; // bb1[0]: scope 0 at src/main.rs:3:29: 8:2
}
bb2: { // cleanup
goto -> bb21; // bb2[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb3: {
StorageDead(_5); // bb3[0]: scope 1 at src/main.rs:5:18: 5:19
goto -> bb4; // bb3[1]: scope 3 at <::std::macros::await macros>:3:24: 7:20
}
bb4: {
StorageLive(_8); // bb4[0]: scope 3 at <::std::macros::await macros>:4:49: 6:69
StorageLive(_9); // bb4[1]: scope 3 at <::std::macros::await macros>:6:1: 6:67
StorageLive(_10); // bb4[2]: scope 5 at <::std::macros::await macros>:6:51: 6:63
StorageLive(_11); // bb4[3]: scope 5 at <::std::macros::await macros>:6:51: 6:63
_11 = &mut (_1.2: impl std::future::Future); // bb4[4]: scope 5 at <::std::macros::await macros>:6:51: 6:63
_10 = &mut (*_11); // bb4[5]: scope 5 at <::std::macros::await macros>:6:51: 6:63
_9 = const <std::pin::Pin<P>>::new_unchecked(move _10) -> [return: bb6, unwind: bb5]; // bb4[6]: scope 5 at <::std::macros::await macros>:6:10: 6:65
// ty::Const
// + ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::await macros>:6:10: 6:48
// + ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}
// + user_ty: UserType(2)
// + literal: Evaluated(Const { ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb5: { // cleanup
drop((_1.2: impl std::future::Future)) -> bb2; // bb5[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb6: {
StorageDead(_10); // bb6[0]: scope 5 at <::std::macros::await macros>:6:64: 6:65
_8 = const std::future::poll_with_tls_waker(move _9) -> [return: bb7, unwind: bb5]; // bb6[1]: scope 3 at <::std::macros::await macros>:4:49: 6:69
// ty::Const
// + ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::await macros>:4:49: 5:20
// + ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}
// + literal: Evaluated(Const { ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb7: {
StorageDead(_9); // bb7[0]: scope 3 at <::std::macros::await macros>:6:68: 6:69
_13 = discriminant(_8); // bb7[1]: scope 3 at <::std::macros::await macros>:4:8: 4:46
switchInt(move _13) -> [0isize: bb9, otherwise: bb8]; // bb7[2]: scope 3 at <::std::macros::await macros>:4:8: 4:46
}
bb8: {
_7 = (); // bb8[0]: scope 3 at <::std::macros::await macros>:4:1: 7:12
StorageDead(_12); // bb8[1]: scope 3 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_8); // bb8[2]: scope 3 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_11); // bb8[3]: scope 3 at <::std::macros::await macros>:7:11: 7:12
StorageLive(_15); // bb8[4]: scope 3 at <::std::macros::await macros>:7:13: 7:18
_15 = (); // bb8[5]: scope 3 at <::std::macros::await macros>:7:13: 7:18
_0 = std::ops::GeneratorState<(), bool>::Yielded(move _15,); // bb8[6]: scope 3 at <::std::macros::await macros>:7:13: 7:18
(_1.0: u32) = const 3u32; // bb8[7]: scope 3 at <::std::macros::await macros>:7:13: 7:18
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 3 })
// mir::Constant
// + span: <::std::macros::await macros>:7:13: 7:18
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 3 }) })
return; // bb8[8]: scope 3 at <::std::macros::await macros>:7:13: 7:18
}
bb9: {
StorageLive(_12); // bb9[0]: scope 3 at <::std::macros::await macros>:4:43: 4:44
_12 = ((_8 as Ready).0: ()); // bb9[1]: scope 3 at <::std::macros::await macros>:4:43: 4:44
_3 = _12; // bb9[2]: scope 6 at <::std::macros::await macros>:7:7: 7:8
StorageDead(_12); // bb9[3]: scope 3 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_8); // bb9[4]: scope 3 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_11); // bb9[5]: scope 3 at <::std::macros::await macros>:7:11: 7:12
drop((_1.2: impl std::future::Future)) -> [return: bb15, unwind: bb2]; // bb9[6]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb10: {
_6 = (); // bb10[0]: scope 3 at <::std::macros::await macros>:7:13: 7:18
StorageDead(_15); // bb10[1]: scope 3 at <::std::macros::await macros>:7:17: 7:18
goto -> bb4; // bb10[2]: scope 3 at <::std::macros::await macros>:3:24: 7:20
}
bb11: { // cleanup
goto -> bb22; // bb11[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb12: {
drop((_1.2: impl std::future::Future)) -> [return: bb13, unwind: bb11]; // bb12[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb13: {
goto -> bb23; // bb13[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb14: {
generator_drop; // bb14[0]: scope 0 at src/main.rs:3:29: 8:2
}
bb15: {
nop; // bb15[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
StorageLive(_16); // bb15[1]: scope 1 at src/main.rs:6:9: 6:13
StorageLive(_17); // bb15[2]: scope 1 at src/main.rs:6:20: 6:28
StorageLive(_18); // bb15[3]: scope 1 at src/main.rs:6:20: 6:21
StorageLive(_19); // bb15[4]: scope 1 at src/main.rs:6:20: 6:21
_19 = &(_1.1: [u8; 1024]); // bb15[5]: scope 1 at src/main.rs:6:20: 6:21
_18 = move _19 as &[u8] (Unsize); // bb15[6]: scope 1 at src/main.rs:6:20: 6:21
StorageDead(_19); // bb15[7]: scope 1 at src/main.rs:6:20: 6:21
_17 = const core::slice::<impl [T]>::iter(move _18) -> [return: bb16, unwind: bb2]; // bb15[8]: scope 1 at src/main.rs:6:20: 6:28
// ty::Const
// + ty: for<'r> fn(&'r [u8]) -> std::slice::Iter<'r, u8> {core::slice::<impl [T]><u8>::iter}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: src/main.rs:6:22: 6:26
// + ty: for<'r> fn(&'r [u8]) -> std::slice::Iter<'r, u8> {core::slice::<impl [T]><u8>::iter}
// + literal: Evaluated(Const { ty: for<'r> fn(&'r [u8]) -> std::slice::Iter<'r, u8> {core::slice::<impl [T]><u8>::iter}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb16: {
StorageDead(_18); // bb16[0]: scope 1 at src/main.rs:6:27: 6:28
_16 = const std::iter::Iterator::sum(move _17) -> [return: bb17, unwind: bb2]; // bb16[1]: scope 1 at src/main.rs:6:20: 6:34
// ty::Const
// + ty: fn(std::slice::Iter<u8>) -> u8 {<std::slice::Iter<u8> as std::iter::Iterator>::sum::<u8>}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: src/main.rs:6:29: 6:32
// + ty: fn(std::slice::Iter<u8>) -> u8 {<std::slice::Iter<u8> as std::iter::Iterator>::sum::<u8>}
// + literal: Evaluated(Const { ty: fn(std::slice::Iter<u8>) -> u8 {<std::slice::Iter<u8> as std::iter::Iterator>::sum::<u8>}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb17: {
StorageDead(_17); // bb17[0]: scope 1 at src/main.rs:6:33: 6:34
_20 = const true; // bb17[1]: scope 7 at src/main.rs:7:5: 7:9
// ty::Const
// + ty: bool
// + val: Scalar(Bits { size: 1, bits: 1 })
// mir::Constant
// + span: src/main.rs:7:5: 7:9
// + ty: bool
// + literal: Evaluated(Const { ty: bool, val: Scalar(Bits { size: 1, bits: 1 }) })
StorageDead(_16); // bb17[2]: scope 1 at src/main.rs:8:1: 8:2
nop; // bb17[3]: scope 0 at src/main.rs:8:1: 8:2
goto -> bb25; // bb17[4]: scope 0 at src/main.rs:8:1: 8:2
}
bb18: {
_0 = std::ops::GeneratorState<(), bool>::Complete(move _20,); // bb18[0]: scope 0 at src/main.rs:8:2: 8:2
(_1.0: u32) = const 1u32; // bb18[1]: scope 0 at src/main.rs:8:2: 8:2
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 1 })
// mir::Constant
// + span: src/main.rs:8:2: 8:2
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 1 }) })
return; // bb18[2]: scope 0 at src/main.rs:8:2: 8:2
}
bb19: {
return; // bb19[0]: scope 0 at src/main.rs:3:29: 8:2
}
bb20: {
goto -> bb27; // bb20[0]: scope 0 at src/main.rs:3:29: 8:2
}
bb21: { // cleanup
goto -> bb1; // bb21[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb22: { // cleanup
goto -> bb1; // bb22[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb23: {
goto -> bb14; // bb23[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb24: { // cleanup
goto -> bb1; // bb24[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb25: {
goto -> bb18; // bb25[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb26: { // cleanup
goto -> bb1; // bb26[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb27: { // cleanup
goto -> bb19; // bb27[0]: scope 0 at src/main.rs:3:29: 8:2
}
}
// MIR for `i_am_1kb::{{closure}}`
// source = MirSource { instance: Item(DefId(0/1:10 ~ foo[16c4]::i_am_1kb[0]::{{closure}}[0])), promoted: None }
// pass_name = generator_pre-elab
// disambiguator = 0
// generator_layout = GeneratorLayout { fields: [LocalDecl { mutability: Not, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutImmutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:4:27: 4:38)), pat_span: src/main.rs:4:9: 4:10 }))), internal: false, is_block_tail: None, ty: [u8; 1024], user_ty: UserTypeProjections { contents: [(UserTypeProjection { base: UserType(0), projs: [] }, src/main.rs:4:12: 4:24)] }, name: Some(x), source_info: SourceInfo { span: src/main.rs:4:9: 4:10, scope: scope[2] }, visibility_scope: scope[1] }, LocalDecl { mutability: Mut, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutMutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:5:12: 5:19)), pat_span: <::std::macros::await macros>:3:5: 3:15 }))), internal: false, is_block_tail: None, ty: impl std::future::Future, user_ty: UserTypeProjections { contents: [] }, name: Some(pinned), source_info: SourceInfo { span: <::std::macros::await macros>:3:5: 3:15, scope: scope[4] }, visibility_scope: scope[3] }] }
| User Type Annotations
| 0: Canonical { max_universe: U0, variables: [], value: Ty([u8; 1024]) } at src/main.rs:4:12: 4:24
| 1: Canonical { max_universe: U0, variables: [], value: Ty([u8; 1024]) } at src/main.rs:4:12: 4:24
| 2: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }, CanonicalVarInfo { kind: Ty(General(U0)) }], value: TypeOf(DefId(2/0:1875 ~ core[ae7c]::pin[0]::{{impl}}[3]::new_unchecked[0]), UserSubsts { substs: [^0], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2/0:1874 ~ core[ae7c]::pin[0]::{{impl}}[3]), self_ty: std::pin::Pin<^1> }) }) } at <::std::macros::await macros>:6:10: 6:48
| 3: Canonical { max_universe: U0, variables: [], value: Ty(u8) } at src/main.rs:6:15: 6:17
| 4: Canonical { max_universe: U0, variables: [], value: Ty(u8) } at src/main.rs:6:15: 6:17
|
fn i_am_1kb::{{closure}}(_1: [static generator@src/main.rs:3:29: 8:2 {[u8; 1024], impl std::future::Future, ()}]) -> std::ops::GeneratorState<(), bool> {
let mut _0: std::ops::GeneratorState<(), bool>; // return place
scope 1 {
scope 3 {
let _12: (); // "x" in scope 3 at <::std::macros::await macros>:4:43: 4:44
scope 5 {
}
scope 6 {
}
}
scope 4 {
}
scope 7 {
}
scope 8 {
let _16: u8 as UserTypeProjection { base: UserType(3), projs: [] }; // "_sum" in scope 8 at src/main.rs:6:9: 6:13
}
}
scope 2 {
}
let mut _2: ();
let mut _3: ();
let mut _4: ();
let mut _5: [static generator@src/main.rs:5:17: 5:19 {}];
let mut _6: ();
let mut _7: ();
let mut _8: std::task::Poll<()>;
let mut _9: std::pin::Pin<&mut impl std::future::Future>;
let mut _10: &mut impl std::future::Future;
let mut _11: &mut impl std::future::Future;
let mut _13: isize;
let mut _14: !;
let mut _15: ();
let mut _17: std::slice::Iter<u8>;
let mut _18: &[u8];
let mut _19: &[u8; 1024];
let mut _20: bool;
bb0: {
nop; // bb0[0]: scope 0 at src/main.rs:4:9: 4:10
(_1.1: [u8; 1024]) = [const 0u8; 1024]; // bb0[1]: scope 0 at src/main.rs:4:27: 4:38
// ty::Const
// + ty: u8
// + val: Scalar(Bits { size: 1, bits: 0 })
// mir::Constant
// + span: src/main.rs:4:28: 4:29
// + ty: u8
// + literal: Evaluated(Const { ty: u8, val: Scalar(Bits { size: 1, bits: 0 }) })
nop; // bb0[2]: scope 1 at <::std::macros::await macros>:3:5: 3:15
StorageLive(_5); // bb0[3]: scope 1 at src/main.rs:5:17: 5:19
_5 = [generator@src/main.rs:5:17: 5:19] { $state: const 0u32 }; // bb0[4]: scope 1 at src/main.rs:5:17: 5:19
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 0 })
// mir::Constant
// + span: src/main.rs:5:17: 5:19
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 0 }) })
// generator
// + def_id: DefId(0/1:15 ~ foo[16c4]::i_am_1kb[0]::{{closure}}[0]::{{closure}}[0])
// + substs: GeneratorSubsts {
// substs: [
// (),
// (),
// {}
// ]
// }
// + movability: Static
(_1.2: impl std::future::Future) = const std::future::from_generator(move _5) -> [return: bb3, unwind: bb2]; // bb0[5]: scope 1 at src/main.rs:5:12: 5:19
// ty::Const
// + ty: fn([static generator@src/main.rs:5:17: 5:19 {}]) -> impl std::future::Future {std::future::from_generator::<[static generator@src/main.rs:5:17: 5:19 {}]>}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: src/main.rs:5:17: 5:19
// + ty: fn([static generator@src/main.rs:5:17: 5:19 {}]) -> impl std::future::Future {std::future::from_generator::<[static generator@src/main.rs:5:17: 5:19 {}]>}
// + literal: Evaluated(Const { ty: fn([static generator@src/main.rs:5:17: 5:19 {}]) -> impl std::future::Future {std::future::from_generator::<[static generator@src/main.rs:5:17: 5:19 {}]>}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb1: { // cleanup
resume; // bb1[0]: scope 0 at src/main.rs:3:29: 8:2
}
bb2: { // cleanup
drop(_1) -> bb1; // bb2[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb3: {
StorageDead(_5); // bb3[0]: scope 1 at src/main.rs:5:18: 5:19
goto -> bb4; // bb3[1]: scope 3 at <::std::macros::await macros>:3:24: 7:20
}
bb4: {
StorageLive(_8); // bb4[0]: scope 3 at <::std::macros::await macros>:4:49: 6:69
StorageLive(_9); // bb4[1]: scope 3 at <::std::macros::await macros>:6:1: 6:67
StorageLive(_10); // bb4[2]: scope 5 at <::std::macros::await macros>:6:51: 6:63
StorageLive(_11); // bb4[3]: scope 5 at <::std::macros::await macros>:6:51: 6:63
_11 = &mut (_1.2: impl std::future::Future); // bb4[4]: scope 5 at <::std::macros::await macros>:6:51: 6:63
_10 = &mut (*_11); // bb4[5]: scope 5 at <::std::macros::await macros>:6:51: 6:63
_9 = const <std::pin::Pin<P>>::new_unchecked(move _10) -> [return: bb6, unwind: bb5]; // bb4[6]: scope 5 at <::std::macros::await macros>:6:10: 6:65
// ty::Const
// + ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::await macros>:6:10: 6:48
// + ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}
// + user_ty: UserType(2)
// + literal: Evaluated(Const { ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb5: { // cleanup
drop((_1.2: impl std::future::Future)) -> bb2; // bb5[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb6: {
StorageDead(_10); // bb6[0]: scope 5 at <::std::macros::await macros>:6:64: 6:65
_8 = const std::future::poll_with_tls_waker(move _9) -> [return: bb7, unwind: bb5]; // bb6[1]: scope 3 at <::std::macros::await macros>:4:49: 6:69
// ty::Const
// + ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::await macros>:4:49: 5:20
// + ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}
// + literal: Evaluated(Const { ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb7: {
StorageDead(_9); // bb7[0]: scope 3 at <::std::macros::await macros>:6:68: 6:69
_13 = discriminant(_8); // bb7[1]: scope 3 at <::std::macros::await macros>:4:8: 4:46
switchInt(move _13) -> [0isize: bb9, otherwise: bb8]; // bb7[2]: scope 3 at <::std::macros::await macros>:4:8: 4:46
}
bb8: {
_7 = (); // bb8[0]: scope 3 at <::std::macros::await macros>:4:1: 7:12
StorageDead(_12); // bb8[1]: scope 3 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_8); // bb8[2]: scope 3 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_11); // bb8[3]: scope 3 at <::std::macros::await macros>:7:11: 7:12
StorageLive(_15); // bb8[4]: scope 3 at <::std::macros::await macros>:7:13: 7:18
_15 = (); // bb8[5]: scope 3 at <::std::macros::await macros>:7:13: 7:18
_0 = std::ops::GeneratorState<(), bool>::Yielded(move _15,); // bb8[6]: scope 3 at <::std::macros::await macros>:7:13: 7:18
(_1.0: u32) = const 3u32; // bb8[7]: scope 3 at <::std::macros::await macros>:7:13: 7:18
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 3 })
// mir::Constant
// + span: <::std::macros::await macros>:7:13: 7:18
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 3 }) })
return; // bb8[8]: scope 3 at <::std::macros::await macros>:7:13: 7:18
}
bb9: {
StorageLive(_12); // bb9[0]: scope 3 at <::std::macros::await macros>:4:43: 4:44
_12 = ((_8 as Ready).0: ()); // bb9[1]: scope 3 at <::std::macros::await macros>:4:43: 4:44
_3 = _12; // bb9[2]: scope 6 at <::std::macros::await macros>:7:7: 7:8
StorageDead(_12); // bb9[3]: scope 3 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_8); // bb9[4]: scope 3 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_11); // bb9[5]: scope 3 at <::std::macros::await macros>:7:11: 7:12
drop((_1.2: impl std::future::Future)) -> [return: bb15, unwind: bb2]; // bb9[6]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb10: {
_6 = (); // bb10[0]: scope 3 at <::std::macros::await macros>:7:13: 7:18
StorageDead(_15); // bb10[1]: scope 3 at <::std::macros::await macros>:7:17: 7:18
goto -> bb4; // bb10[2]: scope 3 at <::std::macros::await macros>:3:24: 7:20
}
bb11: { // cleanup
drop(_1) -> bb1; // bb11[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb12: {
drop((_1.2: impl std::future::Future)) -> [return: bb13, unwind: bb11]; // bb12[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb13: {
drop(_1) -> [return: bb14, unwind: bb1]; // bb13[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb14: {
generator_drop; // bb14[0]: scope 0 at src/main.rs:3:29: 8:2
}
bb15: {
nop; // bb15[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
StorageLive(_16); // bb15[1]: scope 1 at src/main.rs:6:9: 6:13
StorageLive(_17); // bb15[2]: scope 1 at src/main.rs:6:20: 6:28
StorageLive(_18); // bb15[3]: scope 1 at src/main.rs:6:20: 6:21
StorageLive(_19); // bb15[4]: scope 1 at src/main.rs:6:20: 6:21
_19 = &(_1.1: [u8; 1024]); // bb15[5]: scope 1 at src/main.rs:6:20: 6:21
_18 = move _19 as &[u8] (Unsize); // bb15[6]: scope 1 at src/main.rs:6:20: 6:21
StorageDead(_19); // bb15[7]: scope 1 at src/main.rs:6:20: 6:21
_17 = const core::slice::<impl [T]>::iter(move _18) -> [return: bb16, unwind: bb2]; // bb15[8]: scope 1 at src/main.rs:6:20: 6:28
// ty::Const
// + ty: for<'r> fn(&'r [u8]) -> std::slice::Iter<'r, u8> {core::slice::<impl [T]><u8>::iter}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: src/main.rs:6:22: 6:26
// + ty: for<'r> fn(&'r [u8]) -> std::slice::Iter<'r, u8> {core::slice::<impl [T]><u8>::iter}
// + literal: Evaluated(Const { ty: for<'r> fn(&'r [u8]) -> std::slice::Iter<'r, u8> {core::slice::<impl [T]><u8>::iter}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb16: {
StorageDead(_18); // bb16[0]: scope 1 at src/main.rs:6:27: 6:28
_16 = const std::iter::Iterator::sum(move _17) -> [return: bb17, unwind: bb2]; // bb16[1]: scope 1 at src/main.rs:6:20: 6:34
// ty::Const
// + ty: fn(std::slice::Iter<u8>) -> u8 {<std::slice::Iter<u8> as std::iter::Iterator>::sum::<u8>}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: src/main.rs:6:29: 6:32
// + ty: fn(std::slice::Iter<u8>) -> u8 {<std::slice::Iter<u8> as std::iter::Iterator>::sum::<u8>}
// + literal: Evaluated(Const { ty: fn(std::slice::Iter<u8>) -> u8 {<std::slice::Iter<u8> as std::iter::Iterator>::sum::<u8>}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb17: {
StorageDead(_17); // bb17[0]: scope 1 at src/main.rs:6:33: 6:34
_20 = const true; // bb17[1]: scope 7 at src/main.rs:7:5: 7:9
// ty::Const
// + ty: bool
// + val: Scalar(Bits { size: 1, bits: 1 })
// mir::Constant
// + span: src/main.rs:7:5: 7:9
// + ty: bool
// + literal: Evaluated(Const { ty: bool, val: Scalar(Bits { size: 1, bits: 1 }) })
StorageDead(_16); // bb17[2]: scope 1 at src/main.rs:8:1: 8:2
nop; // bb17[3]: scope 0 at src/main.rs:8:1: 8:2
drop(_1) -> [return: bb18, unwind: bb1]; // bb17[4]: scope 0 at src/main.rs:8:1: 8:2
}
bb18: {
_0 = std::ops::GeneratorState<(), bool>::Complete(move _20,); // bb18[0]: scope 0 at src/main.rs:8:2: 8:2
(_1.0: u32) = const 1u32; // bb18[1]: scope 0 at src/main.rs:8:2: 8:2
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 1 })
// mir::Constant
// + span: src/main.rs:8:2: 8:2
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 1 }) })
return; // bb18[2]: scope 0 at src/main.rs:8:2: 8:2
}
bb19: {
return; // bb19[0]: scope 0 at src/main.rs:3:29: 8:2
}
bb20: {
drop(_1) -> bb19; // bb20[0]: scope 0 at src/main.rs:3:29: 8:2
}
}
// MIR for `i_am_1kb::{{closure}}`
// source = MirSource { instance: Item(DefId(0/1:10 ~ foo[16c4]::i_am_1kb[0]::{{closure}}[0])), promoted: None }
// pass_name = generator_resume
// disambiguator = 0
// generator_layout = GeneratorLayout { fields: [LocalDecl { mutability: Not, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutImmutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:4:27: 4:38)), pat_span: src/main.rs:4:9: 4:10 }))), internal: false, is_block_tail: None, ty: [u8; 1024], user_ty: UserTypeProjections { contents: [(UserTypeProjection { base: UserType(0), projs: [] }, src/main.rs:4:12: 4:24)] }, name: Some(x), source_info: SourceInfo { span: src/main.rs:4:9: 4:10, scope: scope[2] }, visibility_scope: scope[1] }, LocalDecl { mutability: Mut, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutMutable), opt_ty_info: None, opt_match_place: Some((None, src/main.rs:5:12: 5:19)), pat_span: <::std::macros::await macros>:3:5: 3:15 }))), internal: false, is_block_tail: None, ty: impl std::future::Future, user_ty: UserTypeProjections { contents: [] }, name: Some(pinned), source_info: SourceInfo { span: <::std::macros::await macros>:3:5: 3:15, scope: scope[4] }, visibility_scope: scope[3] }] }
| User Type Annotations
| 0: Canonical { max_universe: U0, variables: [], value: Ty([u8; 1024]) } at src/main.rs:4:12: 4:24
| 1: Canonical { max_universe: U0, variables: [], value: Ty([u8; 1024]) } at src/main.rs:4:12: 4:24
| 2: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }, CanonicalVarInfo { kind: Ty(General(U0)) }], value: TypeOf(DefId(2/0:1875 ~ core[ae7c]::pin[0]::{{impl}}[3]::new_unchecked[0]), UserSubsts { substs: [^0], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2/0:1874 ~ core[ae7c]::pin[0]::{{impl}}[3]), self_ty: std::pin::Pin<^1> }) }) } at <::std::macros::await macros>:6:10: 6:48
| 3: Canonical { max_universe: U0, variables: [], value: Ty(u8) } at src/main.rs:6:15: 6:17
| 4: Canonical { max_universe: U0, variables: [], value: Ty(u8) } at src/main.rs:6:15: 6:17
|
fn i_am_1kb::{{closure}}(_1: std::pin::Pin<&mut [static generator@src/main.rs:3:29: 8:2 {[u8; 1024], impl std::future::Future, ()}]>) -> std::ops::GeneratorState<(), bool> {
let mut _0: std::ops::GeneratorState<(), bool>; // return place
scope 1 {
scope 3 {
let _12: (); // "x" in scope 3 at <::std::macros::await macros>:4:43: 4:44
scope 5 {
}
scope 6 {
}
}
scope 4 {
}
scope 7 {
}
scope 8 {
let _16: u8 as UserTypeProjection { base: UserType(3), projs: [] }; // "_sum" in scope 8 at src/main.rs:6:9: 6:13
}
}
scope 2 {
}
let mut _2: ();
let mut _3: ();
let mut _4: ();
let mut _5: [static generator@src/main.rs:5:17: 5:19 {}];
let mut _6: ();
let mut _7: ();
let mut _8: std::task::Poll<()>;
let mut _9: std::pin::Pin<&mut impl std::future::Future>;
let mut _10: &mut impl std::future::Future;
let mut _11: &mut impl std::future::Future;
let mut _13: isize;
let mut _14: !;
let mut _15: ();
let mut _17: std::slice::Iter<u8>;
let mut _18: &[u8];
let mut _19: &[u8; 1024];
let mut _20: bool;
bb0: {
switchInt(((*(_1.0: &mut [static generator@src/main.rs:3:29: 8:2 {[u8; 1024], impl std::future::Future, ()}])).0: u32)) -> [0u32: bb1, 1u32: bb19, 2u32: bb20, 3u32: bb18, otherwise: bb21]; // bb0[0]: scope 0 at src/main.rs:3:29: 8:2
}
bb1: {
nop; // bb1[0]: scope 0 at src/main.rs:4:9: 4:10
((*(_1.0: &mut [static generator@src/main.rs:3:29: 8:2 {[u8; 1024], impl std::future::Future, ()}])).1: [u8; 1024]) = [const 0u8; 1024]; // bb1[1]: scope 0 at src/main.rs:4:27: 4:38
// ty::Const
// + ty: u8
// + val: Scalar(Bits { size: 1, bits: 0 })
// mir::Constant
// + span: src/main.rs:4:28: 4:29
// + ty: u8
// + literal: Evaluated(Const { ty: u8, val: Scalar(Bits { size: 1, bits: 0 }) })
nop; // bb1[2]: scope 1 at <::std::macros::await macros>:3:5: 3:15
StorageLive(_5); // bb1[3]: scope 1 at src/main.rs:5:17: 5:19
_5 = [generator@src/main.rs:5:17: 5:19] { $state: const 0u32 }; // bb1[4]: scope 1 at src/main.rs:5:17: 5:19
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 0 })
// mir::Constant
// + span: src/main.rs:5:17: 5:19
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 0 }) })
// generator
// + def_id: DefId(0/1:15 ~ foo[16c4]::i_am_1kb[0]::{{closure}}[0]::{{closure}}[0])
// + substs: GeneratorSubsts {
// substs: [
// (),
// (),
// {}
// ]
// }
// + movability: Static
((*(_1.0: &mut [static generator@src/main.rs:3:29: 8:2 {[u8; 1024], impl std::future::Future, ()}])).2: impl std::future::Future) = const std::future::from_generator(move _5) -> [return: bb4, unwind: bb3]; // bb1[5]: scope 1 at src/main.rs:5:12: 5:19
// ty::Const
// + ty: fn([static generator@src/main.rs:5:17: 5:19 {}]) -> impl std::future::Future {std::future::from_generator::<[static generator@src/main.rs:5:17: 5:19 {}]>}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: src/main.rs:5:17: 5:19
// + ty: fn([static generator@src/main.rs:5:17: 5:19 {}]) -> impl std::future::Future {std::future::from_generator::<[static generator@src/main.rs:5:17: 5:19 {}]>}
// + literal: Evaluated(Const { ty: fn([static generator@src/main.rs:5:17: 5:19 {}]) -> impl std::future::Future {std::future::from_generator::<[static generator@src/main.rs:5:17: 5:19 {}]>}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb2: { // cleanup
((*(_1.0: &mut [static generator@src/main.rs:3:29: 8:2 {[u8; 1024], impl std::future::Future, ()}])).0: u32) = const 1u32; // bb2[0]: scope 0 at src/main.rs:3:29: 8:2
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 1 })
// mir::Constant
// + span: src/main.rs:3:29: 8:2
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 1 }) })
resume; // bb2[1]: scope 0 at src/main.rs:3:29: 8:2
}
bb3: { // cleanup
goto -> bb16; // bb3[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb4: {
StorageDead(_5); // bb4[0]: scope 1 at src/main.rs:5:18: 5:19
goto -> bb5; // bb4[1]: scope 3 at <::std::macros::await macros>:3:24: 7:20
}
bb5: {
StorageLive(_8); // bb5[0]: scope 3 at <::std::macros::await macros>:4:49: 6:69
StorageLive(_9); // bb5[1]: scope 3 at <::std::macros::await macros>:6:1: 6:67
StorageLive(_10); // bb5[2]: scope 5 at <::std::macros::await macros>:6:51: 6:63
StorageLive(_11); // bb5[3]: scope 5 at <::std::macros::await macros>:6:51: 6:63
_11 = &mut ((*(_1.0: &mut [static generator@src/main.rs:3:29: 8:2 {[u8; 1024], impl std::future::Future, ()}])).2: impl std::future::Future); // bb5[4]: scope 5 at <::std::macros::await macros>:6:51: 6:63
_10 = &mut (*_11); // bb5[5]: scope 5 at <::std::macros::await macros>:6:51: 6:63
_9 = const <std::pin::Pin<P>>::new_unchecked(move _10) -> [return: bb7, unwind: bb6]; // bb5[6]: scope 5 at <::std::macros::await macros>:6:10: 6:65
// ty::Const
// + ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::await macros>:6:10: 6:48
// + ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}
// + user_ty: UserType(2)
// + literal: Evaluated(Const { ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb6: { // cleanup
drop(((*(_1.0: &mut [static generator@src/main.rs:3:29: 8:2 {[u8; 1024], impl std::future::Future, ()}])).2: impl std::future::Future)) -> bb3; // bb6[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb7: {
StorageDead(_10); // bb7[0]: scope 5 at <::std::macros::await macros>:6:64: 6:65
_8 = const std::future::poll_with_tls_waker(move _9) -> [return: bb8, unwind: bb6]; // bb7[1]: scope 3 at <::std::macros::await macros>:4:49: 6:69
// ty::Const
// + ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::await macros>:4:49: 5:20
// + ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}
// + literal: Evaluated(Const { ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb8: {
StorageDead(_9); // bb8[0]: scope 3 at <::std::macros::await macros>:6:68: 6:69
_13 = discriminant(_8); // bb8[1]: scope 3 at <::std::macros::await macros>:4:8: 4:46
switchInt(move _13) -> [0isize: bb10, otherwise: bb9]; // bb8[2]: scope 3 at <::std::macros::await macros>:4:8: 4:46
}
bb9: {
_7 = (); // bb9[0]: scope 3 at <::std::macros::await macros>:4:1: 7:12
StorageDead(_12); // bb9[1]: scope 3 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_8); // bb9[2]: scope 3 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_11); // bb9[3]: scope 3 at <::std::macros::await macros>:7:11: 7:12
StorageLive(_15); // bb9[4]: scope 3 at <::std::macros::await macros>:7:13: 7:18
_15 = (); // bb9[5]: scope 3 at <::std::macros::await macros>:7:13: 7:18
_0 = std::ops::GeneratorState<(), bool>::Yielded(move _15,); // bb9[6]: scope 3 at <::std::macros::await macros>:7:13: 7:18
((*(_1.0: &mut [static generator@src/main.rs:3:29: 8:2 {[u8; 1024], impl std::future::Future, ()}])).0: u32) = const 3u32; // bb9[7]: scope 3 at <::std::macros::await macros>:7:13: 7:18
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 3 })
// mir::Constant
// + span: <::std::macros::await macros>:7:13: 7:18
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 3 }) })
return; // bb9[8]: scope 3 at <::std::macros::await macros>:7:13: 7:18
}
bb10: {
StorageLive(_12); // bb10[0]: scope 3 at <::std::macros::await macros>:4:43: 4:44
_12 = ((_8 as Ready).0: ()); // bb10[1]: scope 3 at <::std::macros::await macros>:4:43: 4:44
_3 = _12; // bb10[2]: scope 6 at <::std::macros::await macros>:7:7: 7:8
StorageDead(_12); // bb10[3]: scope 3 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_8); // bb10[4]: scope 3 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_11); // bb10[5]: scope 3 at <::std::macros::await macros>:7:11: 7:12
drop(((*(_1.0: &mut [static generator@src/main.rs:3:29: 8:2 {[u8; 1024], impl std::future::Future, ()}])).2: impl std::future::Future)) -> [return: bb12, unwind: bb3]; // bb10[6]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
bb11: {
_6 = (); // bb11[0]: scope 3 at <::std::macros::await macros>:7:13: 7:18
StorageDead(_15); // bb11[1]: scope 3 at <::std::macros::await macros>:7:17: 7:18
goto -> bb5; // bb11[2]: scope 3 at <::std::macros::await macros>:3:24: 7:20
}
bb12: {
nop; // bb12[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
StorageLive(_16); // bb12[1]: scope 1 at src/main.rs:6:9: 6:13
StorageLive(_17); // bb12[2]: scope 1 at src/main.rs:6:20: 6:28
StorageLive(_18); // bb12[3]: scope 1 at src/main.rs:6:20: 6:21
StorageLive(_19); // bb12[4]: scope 1 at src/main.rs:6:20: 6:21
_19 = &((*(_1.0: &mut [static generator@src/main.rs:3:29: 8:2 {[u8; 1024], impl std::future::Future, ()}])).1: [u8; 1024]); // bb12[5]: scope 1 at src/main.rs:6:20: 6:21
_18 = move _19 as &[u8] (Unsize); // bb12[6]: scope 1 at src/main.rs:6:20: 6:21
StorageDead(_19); // bb12[7]: scope 1 at src/main.rs:6:20: 6:21
_17 = const core::slice::<impl [T]>::iter(move _18) -> [return: bb13, unwind: bb3]; // bb12[8]: scope 1 at src/main.rs:6:20: 6:28
// ty::Const
// + ty: for<'r> fn(&'r [u8]) -> std::slice::Iter<'r, u8> {core::slice::<impl [T]><u8>::iter}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: src/main.rs:6:22: 6:26
// + ty: for<'r> fn(&'r [u8]) -> std::slice::Iter<'r, u8> {core::slice::<impl [T]><u8>::iter}
// + literal: Evaluated(Const { ty: for<'r> fn(&'r [u8]) -> std::slice::Iter<'r, u8> {core::slice::<impl [T]><u8>::iter}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb13: {
StorageDead(_18); // bb13[0]: scope 1 at src/main.rs:6:27: 6:28
_16 = const std::iter::Iterator::sum(move _17) -> [return: bb14, unwind: bb3]; // bb13[1]: scope 1 at src/main.rs:6:20: 6:34
// ty::Const
// + ty: fn(std::slice::Iter<u8>) -> u8 {<std::slice::Iter<u8> as std::iter::Iterator>::sum::<u8>}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: src/main.rs:6:29: 6:32
// + ty: fn(std::slice::Iter<u8>) -> u8 {<std::slice::Iter<u8> as std::iter::Iterator>::sum::<u8>}
// + literal: Evaluated(Const { ty: fn(std::slice::Iter<u8>) -> u8 {<std::slice::Iter<u8> as std::iter::Iterator>::sum::<u8>}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
bb14: {
StorageDead(_17); // bb14[0]: scope 1 at src/main.rs:6:33: 6:34
_20 = const true; // bb14[1]: scope 7 at src/main.rs:7:5: 7:9
// ty::Const
// + ty: bool
// + val: Scalar(Bits { size: 1, bits: 1 })
// mir::Constant
// + span: src/main.rs:7:5: 7:9
// + ty: bool
// + literal: Evaluated(Const { ty: bool, val: Scalar(Bits { size: 1, bits: 1 }) })
StorageDead(_16); // bb14[2]: scope 1 at src/main.rs:8:1: 8:2
nop; // bb14[3]: scope 0 at src/main.rs:8:1: 8:2
goto -> bb17; // bb14[4]: scope 0 at src/main.rs:8:1: 8:2
}
bb15: {
_0 = std::ops::GeneratorState<(), bool>::Complete(move _20,); // bb15[0]: scope 0 at src/main.rs:8:2: 8:2
((*(_1.0: &mut [static generator@src/main.rs:3:29: 8:2 {[u8; 1024], impl std::future::Future, ()}])).0: u32) = const 1u32; // bb15[1]: scope 0 at src/main.rs:8:2: 8:2
// ty::Const
// + ty: u32
// + val: Scalar(Bits { size: 4, bits: 1 })
// mir::Constant
// + span: src/main.rs:8:2: 8:2
// + ty: u32
// + literal: Evaluated(Const { ty: u32, val: Scalar(Bits { size: 4, bits: 1 }) })
return; // bb15[2]: scope 0 at src/main.rs:8:2: 8:2
}
bb16: { // cleanup
goto -> bb2; // bb16[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb17: {
goto -> bb15; // bb17[0]: scope 0 at src/main.rs:8:1: 8:2
}
bb18: {
StorageLive(_15); // bb18[0]: scope 0 at src/main.rs:3:29: 8:2
goto -> bb11; // bb18[1]: scope 0 at src/main.rs:3:29: 8:2
}
bb19: {
assert(const false, "generator resumed after completion") -> bb19; // bb19[0]: scope 0 at src/main.rs:3:29: 8:2
// ty::Const
// + ty: bool
// + val: Scalar(Bits { size: 1, bits: 0 })
// mir::Constant
// + span: src/main.rs:3:29: 8:2
// + ty: bool
// + literal: Evaluated(Const { ty: bool, val: Scalar(Bits { size: 1, bits: 0 }) })
}
bb20: {
assert(const false, "generator resumed after panicking") -> bb20; // bb20[0]: scope 0 at src/main.rs:3:29: 8:2
// ty::Const
// + ty: bool
// + val: Scalar(Bits { size: 1, bits: 0 })
// mir::Constant
// + span: src/main.rs:3:29: 8:2
// + ty: bool
// + literal: Evaluated(Const { ty: bool, val: Scalar(Bits { size: 1, bits: 0 }) })
}
bb21: {
unreachable; // bb21[0]: scope 0 at src/main.rs:3:29: 8:2
}
}
// MIR local liveness analysis for `composed::{{closure}}`
// source = MirSource { instance: Item(DefId(0/1:14 ~ foo[16c4]::composed[0]::{{closure}}[0])), promoted: None }
// pass_name = generator_liveness
fn composed::{{closure}}(_1: [static generator@src/main.rs:10:21: 14:2 {impl std::future::Future, ()}]) -> std::ops::GeneratorState<(), ()>
yields ()
{
let mut _0: std::ops::GeneratorState<(), ()>; // return place
scope 1 {
scope 3 {
}
scope 4 {
let _4: &impl std::future::Future; // "_foo" in scope 4 at src/main.rs:12:11: 12:15
}
scope 5 {
let _13: bool; // "x" in scope 5 at <::std::macros::await macros>:4:43: 4:44
scope 7 {
}
scope 8 {
}
}
scope 6 {
let mut _6: impl std::future::Future; // "pinned" in scope 6 at <::std::macros::await macros>:3:5: 3:15
}
}
scope 2 {
let _2: impl std::future::Future; // "inner" in scope 2 at src/main.rs:11:9: 11:14
}
let mut _3: ();
let mut _5: bool;
let mut _7: ();
let mut _8: ();
let mut _9: std::task::Poll<bool>;
let mut _10: std::pin::Pin<&mut impl std::future::Future>;
let mut _11: &mut impl std::future::Future;
let mut _12: &mut impl std::future::Future;
let mut _14: isize;
let mut _15: !;
let mut _16: ();
let mut _17: ();
bb0: {
StorageLive(_2); // bb0[0]: scope 0 at src/main.rs:11:9: 11:14
_2 = const i_am_1kb() -> [return: bb2, unwind: bb3]; // bb0[1]: scope 0 at src/main.rs:11:17: 11:27
// ty::Const
// + ty: fn() -> impl std::future::Future {i_am_1kb}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: src/main.rs:11:17: 11:25
// + ty: fn() -> impl std::future::Future {i_am_1kb}
// + literal: Evaluated(Const { ty: fn() -> impl std::future::Future {i_am_1kb}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
{_1, _2}
bb1: { // cleanup
resume; // bb1[0]: scope 0 at src/main.rs:10:21: 14:2
}
{}
bb2: {
StorageLive(_4); // bb2[0]: scope 1 at src/main.rs:12:11: 12:15
_4 = &_2; // bb2[1]: scope 1 at src/main.rs:12:18: 12:24
_3 = (); // bb2[2]: scope 1 at src/main.rs:12:5: 12:27
StorageDead(_4); // bb2[3]: scope 1 at src/main.rs:12:26: 12:27
StorageLive(_6); // bb2[4]: scope 1 at <::std::macros::await macros>:3:5: 3:15
_6 = move _2; // bb2[5]: scope 1 at src/main.rs:13:12: 13:17
goto -> bb4; // bb2[6]: scope 5 at <::std::macros::await macros>:3:24: 7:20
}
{_1, _6}
bb3: { // cleanup
drop(_1) -> bb1; // bb3[0]: scope 0 at src/main.rs:14:1: 14:2
}
{}
bb4: {
StorageLive(_9); // bb4[0]: scope 5 at <::std::macros::await macros>:4:49: 6:69
StorageLive(_10); // bb4[1]: scope 5 at <::std::macros::await macros>:6:1: 6:67
StorageLive(_11); // bb4[2]: scope 7 at <::std::macros::await macros>:6:51: 6:63
StorageLive(_12); // bb4[3]: scope 7 at <::std::macros::await macros>:6:51: 6:63
_12 = &mut _6; // bb4[4]: scope 7 at <::std::macros::await macros>:6:51: 6:63
_11 = &mut (*_12); // bb4[5]: scope 7 at <::std::macros::await macros>:6:51: 6:63
_10 = const <std::pin::Pin<P>>::new_unchecked(move _11) -> [return: bb6, unwind: bb5]; // bb4[6]: scope 7 at <::std::macros::await macros>:6:10: 6:65
// ty::Const
// + ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::await macros>:6:10: 6:48
// + ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}
// + user_ty: UserType(0)
// + literal: Evaluated(Const { ty: unsafe fn(&mut impl std::future::Future) -> std::pin::Pin<&mut impl std::future::Future> {<std::pin::Pin<P>><&mut impl std::future::Future>::new_unchecked}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
{_1, _6, _10}
bb5: { // cleanup
drop(_6) -> bb3; // bb5[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
{_1}
bb6: {
StorageDead(_11); // bb6[0]: scope 7 at <::std::macros::await macros>:6:64: 6:65
_9 = const std::future::poll_with_tls_waker(move _10) -> [return: bb7, unwind: bb5]; // bb6[1]: scope 5 at <::std::macros::await macros>:4:49: 6:69
// ty::Const
// + ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}
// + val: Scalar(Bits { size: 0, bits: 0 })
// mir::Constant
// + span: <::std::macros::await macros>:4:49: 5:20
// + ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}
// + literal: Evaluated(Const { ty: for<'r> fn(std::pin::Pin<&'r mut impl std::future::Future>) -> std::task::Poll<<impl std::future::Future as std::future::Future>::Output> {std::future::poll_with_tls_waker::<impl std::future::Future>}, val: Scalar(Bits { size: 0, bits: 0 }) })
}
{_1, _6, _9}
bb7: {
StorageDead(_10); // bb7[0]: scope 5 at <::std::macros::await macros>:6:68: 6:69
_14 = discriminant(_9); // bb7[1]: scope 5 at <::std::macros::await macros>:4:8: 4:46
switchInt(move _14) -> [0isize: bb9, otherwise: bb8]; // bb7[2]: scope 5 at <::std::macros::await macros>:4:8: 4:46
}
{_1, _6, _9}
bb8: {
_8 = (); // bb8[0]: scope 5 at <::std::macros::await macros>:4:1: 7:12
StorageDead(_13); // bb8[1]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_9); // bb8[2]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_12); // bb8[3]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageLive(_16); // bb8[4]: scope 5 at <::std::macros::await macros>:7:13: 7:18
_16 = (); // bb8[5]: scope 5 at <::std::macros::await macros>:7:13: 7:18
_1 = suspend(move _16) -> [resume: bb10, drop: bb12]; // bb8[6]: scope 5 at <::std::macros::await macros>:7:13: 7:18
}
{_1, _6}
bb9: {
StorageLive(_13); // bb9[0]: scope 5 at <::std::macros::await macros>:4:43: 4:44
_13 = ((_9 as Ready).0: bool); // bb9[1]: scope 5 at <::std::macros::await macros>:4:43: 4:44
_5 = _13; // bb9[2]: scope 8 at <::std::macros::await macros>:7:7: 7:8
StorageDead(_13); // bb9[3]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_9); // bb9[4]: scope 5 at <::std::macros::await macros>:7:11: 7:12
StorageDead(_12); // bb9[5]: scope 5 at <::std::macros::await macros>:7:11: 7:12
drop(_6) -> [return: bb15, unwind: bb3]; // bb9[6]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
{_1}
bb10: {
_7 = (); // bb10[0]: scope 5 at <::std::macros::await macros>:7:13: 7:18
StorageDead(_16); // bb10[1]: scope 5 at <::std::macros::await macros>:7:17: 7:18
goto -> bb4; // bb10[2]: scope 5 at <::std::macros::await macros>:3:24: 7:20
}
{_1, _6}
bb11: { // cleanup
drop(_1) -> bb1; // bb11[0]: scope 0 at src/main.rs:14:1: 14:2
}
{}
bb12: {
drop(_6) -> [return: bb13, unwind: bb11]; // bb12[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
}
{_1}
bb13: {
drop(_1) -> [return: bb14, unwind: bb1]; // bb13[0]: scope 0 at src/main.rs:14:1: 14:2
}
{}
bb14: {
generator_drop; // bb14[0]: scope 0 at src/main.rs:10:21: 14:2
}
{}
bb15: {
StorageDead(_6); // bb15[0]: scope 1 at <::std::macros::await macros>:7:21: 7:22
_17 = (); // bb15[1]: scope 0 at src/main.rs:10:21: 14:2
StorageDead(_2); // bb15[2]: scope 0 at src/main.rs:14:1: 14:2
drop(_1) -> [return: bb16, unwind: bb1]; // bb15[3]: scope 0 at src/main.rs:14:1: 14:2
}
{}
bb16: {
return; // bb16[0]: scope 0 at src/main.rs:14:2: 14:2
}
{}
}
// MIR local liveness analysis for `i_am_1kb::{{closure}}::{{closure}}`
// source = MirSource { instance: Item(DefId(0/1:15 ~ foo[16c4]::i_am_1kb[0]::{{closure}}[0]::{{closure}}[0])), promoted: None }
// pass_name = generator_liveness
fn i_am_1kb::{{closure}}::{{closure}}(_1: [static generator@src/main.rs:5:17: 5:19 {}]) -> std::ops::GeneratorState<(), ()>
yields ()
{
let mut _0: std::ops::GeneratorState<(), ()>; // return place
let mut _2: ();
bb0: {
_2 = (); // bb0[0]: scope 0 at src/main.rs:5:17: 5:19
drop(_1) -> [return: bb1, unwind: bb2]; // bb0[1]: scope 0 at src/main.rs:5:18: 5:19
}
{}
bb1: {
return; // bb1[0]: scope 0 at src/main.rs:5:19: 5:19
}
{}
bb2: { // cleanup
resume; // bb2[0]: scope 0 at src/main.rs:5:17: 5:19
}
{}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment