Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRustasync/await state machineSingle-choice MCQ

In the lowered state machine, a local variable that is live across an `.await` is stored as a field of the generated future, while a local that is NOT live across any `.await` is kept on the poll stack frame. Given the code, where does `tmp` live?

async fn f(input: &[u8]) -> usize { let n = input.len(); // used after await let tmp = compute(input); // used only here, before any await drop(tmp); some_async_op().await; n }