-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic Futures #3434
base: master
Are you sure you want to change the base?
Generic Futures #3434
Conversation
Nice try! |
Cheeky, I actually went and checked the template again x) For reference, here's a RFC I previous opened on trying to make the current Waker ABI stable without causing breaks in the std library. Unfortunately, doing so would impose a runtime cost on every program that uses futures, regardless of whether or not they care about ABI stability, which doomed said RFC. With this proposal, new wakers can be created to fit any design constraint we please, provided they have interior mutability (and by adding a |
@rustbot label A-futures |
The desugaring of async functions/blocks seems under-spec'd to me. Like, if |
Indeed, this makes desugaring to RPIT impossible without adding a generic argument to the funciton. Ideally, it would desugar to But to my knowledge, it is So I think |
In other words to be more accurate it desugars to
And you still have the same problem, because it is the … and if the poll method was generic instead, the trait would stop being object safe, so it would stop working in a Box and that is also essential. |
On the contrary, the I've updated the RFC to make these anonymous type shenanigans more readable. Thanks for the input :) |
Your rendered link is broken |
Thanks for notifying me, it should be fixed now :) |
text/3434-generic-futures.md
Outdated
- RFC PR: [rust-lang/rfcs#0000](https://github.com/rust-lang/rfcs/pull/3434) | ||
- Rust Issue: [rust-lang/rust#0000](https://github.com/rust-lang/rust/issues/0000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your "Rendered" link in the first comment of this pull-request is broken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ops, it looks I forgot to "comments" my "Pending" review several days (
I'd think that changes to wakers and futures would consider a way to leave some room for completion-based (as opposed to readiness-based) asynchrony. Maybe that's outside of the scope here. Maybe not. |
We should probably nominate this for the @rust-lang/wg-async triage. I don't think we have a label for that here, but tagging us so we can track it. |
Thanks @yoshuawuyts If anyone knowledgeable is reading this, I'm looking for some help in prototyping this RFC. I'm not familiar with the I'm looking at modifying |
That desugaring cannot be made into a concrete type, so most likely this: and if so, potential executor trait can be given an assoc type for precisely its context, then we can have
In the air: adapter between executors so that it's possible to have more than one? |
This RFC proposes adding a (defaulted) generic parameter to the
core::future::Future
trait to allow more flexibility inFuture::poll
's second argument (context
).This is would allow new
Waker
s to be created, that may be used to:Rendered