Replace usage of ResumeTy in async lowering with Context
Replaces using `ResumeTy` / `get_context` in favor of using `&'static mut Context<'_>`. Usage of the `'static` lifetime here is technically "cheating", and replaces the raw pointer in `ResumeTy` and the `get_context` fn that pulls the correct lifetimes out of thin air.
This commit is contained in:
committed by
Arpad Borsos
parent
ed61c139c2
commit
cf031a3355
@@ -174,6 +174,7 @@ impl RawWakerVTable {
|
||||
/// Currently, `Context` only serves to provide access to a [`&Waker`](Waker)
|
||||
/// which can be used to wake the current task.
|
||||
#[stable(feature = "futures_api", since = "1.36.0")]
|
||||
#[cfg_attr(not(bootstrap), lang = "Context")]
|
||||
pub struct Context<'a> {
|
||||
waker: &'a Waker,
|
||||
// Ensure we future-proof against variance changes by forcing
|
||||
|
||||
Reference in New Issue
Block a user