3 fn is_unwindsafe(_: impl std::panic::UnwindSafe) {}
6 // A normal future created by an async block takes a `&mut Context<'_>` argument.
7 // That should not leak through to the whole async block.
9 async {}.await; // this needs an inner await point
13 //~^ ERROR the type `&mut Context<'_>` may not be safely transferred across an unwind boundary
15 use std::task::{Context, RawWaker, RawWakerVTable, Waker};
17 Waker::from_raw(RawWaker::new(
19 &RawWakerVTable::new(|_| todo!(), |_| todo!(), |_| todo!(), |_| todo!()),
22 let mut cx = Context::from_waker(&waker);
25 async {}.await; // this needs an inner await point
27 // in this case, `&mut Context<'_>` is *truly* alive across an await point