-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add doc for impl From for Waker #53507
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
@bors delegate=skade |
✌️ @skade can now approve this pull request |
Ping from triage @skade! This PR needs your review. |
Ping from triage @skade / @rust-lang/docs: This PR requires your review. |
Please add an example. |
Hey, I am currently traveling, will look at this again in around 3 weeks. |
No problem, we'll wait for you! |
@GuillaumeGomez writing examples for this seems harder than I expected, e.g. creating LocalWake of some sort of UnsafeWake Do you have any good examples or good documents about these things? And also not sure with all movement of futures api, are these struct gonna be necessary? |
Nothing coming to my mind right now... In the worst case, just show a code example demonstrating how the |
@GuillaumeGomez Do you know how to create a |
Never used it so no. Maybe someone from the @rust-lang/libs or @rust-lang/compiler might know? |
You can use |
Even with cramertj's links, it's not immediately clear how to instantiate these for doc example purposes, so this PR seems good as-is. Thanks for your contribution @phungleson! @bors r+ rollup |
📌 Commit a84782cb0785b3b3f6cb5af73b5256bffa2a4083 has been approved by |
⌛ Testing commit a84782cb0785b3b3f6cb5af73b5256bffa2a4083 with merge 29d791f6c6c7ee2dbbed0b5b132c0fa14387baa1... |
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors r- |
Ping form triage @phungleson: It looks like your PR failed on travis and needs to updated. |
Ping from triage @withoutboats: It looks like this PR is now ready for your review. |
src/libcore/task/wake.rs
Outdated
@@ -188,6 +188,10 @@ impl LocalWaker { | |||
} | |||
|
|||
impl From<LocalWaker> for Waker { | |||
/// Converts a `LocalWaker` into a `Waker`. | |||
/// | |||
/// This conversion forgets local waker and allocates a new waker with |
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.
allocate
is misleading here, since no new allocation is occurring. What about "This conversion turns a !Sync
LocalWaker
into a Sync
Waker
, allowing a wakeup object to be sent to another thread, but giving up its ability to do specialized thread-local wakeup behavior."
Thanks @cramertj it is updated |
@bors r+ rollup |
📌 Commit 3539132 has been approved by |
… r=cramertj Add doc for impl From for Waker As part of issue rust-lang#51430 (cc @skade). The impl is very simple, so not sure if we need to go into any details.
… r=cramertj Add doc for impl From for Waker As part of issue rust-lang#51430 (cc @skade). The impl is very simple, so not sure if we need to go into any details.
Rollup of 22 pull requests Successful merges: - #53507 (Add doc for impl From for Waker) - #53931 (Gradually expanding libstd's keyword documentation) - #54965 (update tcp stream documentation) - #54977 (Accept `Option<Box<$t:ty>>` in macro argument) - #55138 (in which unused-parens suggestions heed what the user actually wrote) - #55173 (Suggest appropriate syntax on missing lifetime specifier in return type) - #55200 (Documents `From` implementations for `Stdio`) - #55245 (submodules: update clippy from 5afdf8b to b1d0343) - #55247 (Clarified code example in char primitive doc) - #55251 (Fix a typo in the documentation of RangeInclusive) - #55253 (only issue "variant of the expected type" suggestion for enums) - #55254 (Correct trailing ellipsis in name_from_pat) - #55269 (fix typos in various places) - #55282 (Remove redundant clone) - #55285 (Do some copy editing on the release notes) - #55291 (Update stdsimd submodule) - #55296 (Set RUST_BACKTRACE=0 for rustdoc-ui/failed-doctest-output.rs) - #55306 (Regression test for #54478.) - #55328 (Fix doc for new copysign functions) - #55340 (Operands no longer appear in places) - #55345 (Remove is_null) - #55348 (Update RELEASES.md after destabilization of non_modrs_mods) Failed merges: r? @ghost
As part of issue #51430 (cc @skade).
The impl is very simple, so not sure if we need to go into any details.