Skip to content
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

Merged
merged 3 commits into from
Oct 25, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/libcore/task/wake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

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."

/// the same inner.
#[inline]
fn from(local_waker: LocalWaker) -> Self {
local_waker.0
Expand Down