Currently, Context only serves to provide access to a &Waker which can be used to wake the current task.
Is Context ever going to provide more?
Relatedly, in typical implementations of select, when the future is polled, it must internally poll every future it manages because the wakeup has no additional information about which future woke it up. Why doesn't poll take an extra argument (or Context contain something) to remedy this? Did the Future trait work like this at some point, allowing coroutines that could be resumed with a value?
Possibly. Context::ext() and Context::local_waker() are two experiments in providing more. That said, it is quite possible that neither of these will stabilize.
What type would that argument be?
If it was a type determined by the Future, that would greatly reduce the ability to use dyn Future.
How would you make use of that pointer soundly? Remember, futures can be, and are, polled by safe code. They cannot rely on untyped data in the Context being what they expect it to be.
There’s also a composition problem: what if two different combinators like select both want to use this data? In a typed, generic system, the outer one could contain and preserve the data of the inner one, but if you make the data be untyped or dyn Any then it would have to allocate the data on the heap, and that’s a performance limitation.