-
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
RFC: stabilize std::task
and std::future::Future
#2592
Merged
+616
−0
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
7d364aa
RFC: add Async trait and task system to libcore
aturon 0ded7b7
Revamp RFC to one-trait approach
aturon 01ce3f9
Revamp for stabilization
aturon bb242c8
Address nits
aturon 1c8961e
Typo
aturon 96ba924
Move the descriptions of LocalWaker and Waker and the primary focus.
Matthias247 2ff9713
Add a comment why RawWaker is used
Matthias247 e40dab4
Update the section about ArcWake
Matthias247 405361a
fix sentence
Matthias247 4cbbba8
Consume LocalWakers on conversion to Waker
Matthias247 de6b949
Add suggestions around syntax.
Matthias247 fdb41f8
Allow clone to alter the vtable
Matthias247 af29613
update wording
Matthias247 04695be
Apply suggestions from code review
Matthias247 e025c59
Fix ArcWake methods
Matthias247 db5f882
Add additional clarification around RawWaker
Matthias247 e1d2b8f
Remove LocalWaker and simplify the RawWakerVTable
cramertj 05db198
Merge pull request #16 from cramertj/less-waker
cramertj af3da95
Cleanup
cramertj eff2eca
Merge pull request #17 from cramertj/futures-cleanup
cramertj a268c75
typo fix
dyxushuai 834f0cd
typo
dyxushuai 4e9e72c
Merge pull request #19 from dyxushuai/patch-2
aturon 4825174
Merge pull request #18 from dyxushuai/patch-1
aturon f50c0c4
Apply suggestions from code review
cramertj e7eaea1
RFC 2592
cramertj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Address nits
commit bb242c8cc6ee2f873e6f95d1bf02cedf4cded468
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I first thought this would refer to the example just above, but there is no trait object there, is there? An example for what this remark refers to would be nice.
I fist thought one could just add
Clone
to the supertraits, but I guess that would destroy object safety.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.
LocalWaker
andWaker
are themselves trait objects. Both work out to something like*const UnsafeWake
. Implementing theWake
trait gives you an implementation ofUnsafeWake
forArc<YourType>
.This API can be awkward to work with in some edge cases though where you want to change the vtable without changing the underlying pointed to type. @aturon is working on a modification of the proposal, and I've suggested considering that we use a more C-like manual vtable instead. This would allow us more flexibility, make type-punning-to-change-the-vtable unnecessary, and removes the hairy questions around whether or not
*const UnsafeWake
must have a valid vtable.