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

Consider this async function. How many distinct suspend states does the compiler-generated state machine have, counting the initial 'not yet started' state and the final 'completed' state?

async fn f(a: impl Future<Output=()>, b: impl Future<Output=()>) { a.await; b.await; }