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

Consider the drop behavior of a partially-driven future. The future below is polled once (suspending at the `.await`), then dropped without being polled to completion. What is guaranteed about `guard`?

async fn f() { let guard = Guard; // Drop logs "drop guard" some_pending().await; // suspends here on first poll let other = Guard; // never reached let _ = other; } // poll once (-> Pending), then drop the future